OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 22-Jan-2003 13:22:08
Branch: OPENPKG_1_1_SOLID Handle: 2003012212220700
Added files: (Branch: OPENPKG_1_1_SOLID)
openpkg-src/php php.patch
Modified files: (Branch: OPENPKG_1_1_SOLID)
openpkg-src/php php.spec
Log:
SA-2003.005-php; CAN-2002-1396
Summary:
Revision Changes Path
1.1.2.1 +105 -0 openpkg-src/php/php.patch
1.26.2.2 +2 -0 openpkg-src/php/php.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/php/php.patch
============================================================================
$ cvs diff -u -r0 -r1.1.2.1 php.patch
--- /dev/null 2003-01-22 13:22:08.000000000 +0100
+++ php.patch 2003-01-22 13:22:08.000000000 +0100
@@ -0,0 +1,105 @@
+--- ext/standard/string.c.orig Wed Jan 22 10:10:45 2003
++++ ext/standard/string.c Wed Jan 22 11:40:13 2003
+@@ -616,7 +616,7 @@
+ {
+ const char *text, *breakchar = "\n";
+ char *newtext;
+- int textlen, breakcharlen = 1, newtextlen;
++ int textlen, breakcharlen = 1, newtextlen, alloced, chk;
+ long current = 0, laststart = 0, lastspace = 0;
+ long linelength = 75;
+ zend_bool docut = 0;
+@@ -642,38 +642,40 @@
+ for (current = 0; current < textlen; current++) {
+ if (text[current] == breakchar[0]) {
+ laststart = lastspace = current;
+- }
+- else if (text[current] == ' ') {
++ } else if (text[current] == ' ') {
+ if (current - laststart >= linelength) {
+ newtext[current] = breakchar[0];
+ laststart = current;
+ }
+ lastspace = current;
+- }
+- else if (current - laststart >= linelength
+- && laststart != lastspace) {
++ } else if (current - laststart >= linelength && laststart !=
lastspace) {
+ newtext[lastspace] = breakchar[0];
+ laststart = lastspace;
+ }
+ }
+
+ RETURN_STRINGL(newtext, textlen, 0);
+- }
+- else {
++ } else {
+ /* Multiple character line break or forced cut */
+ if (linelength > 0) {
+- newtextlen = textlen + (textlen/linelength + 1) * breakcharlen
+ 1;
+- }
+- else {
+- newtextlen = textlen * (breakcharlen + 1) + 1;
++ chk = (int)(textlen/linelength + 1);
++ alloced = textlen + chk * breakcharlen + 1;
++ } else {
++ chk = textlen;
++ alloced = textlen * (breakcharlen + 1) + 1;
+ }
+- newtext = emalloc(newtextlen);
++ newtext = emalloc(alloced);
+
+ /* now keep track of the actual new text length */
+ newtextlen = 0;
+
+ laststart = lastspace = 0;
+ for (current = 0; current < textlen; current++) {
++ if (chk <= 0) {
++ alloced += (int) (((textlen - current + 1)/linelength
+ 1) * breakcharlen) + 1;
++ newtext = erealloc(newtext, alloced);
++ chk = (int) ((textlen - current)/linelength) + 1;
++ }
+ /* when we hit an existing break, copy to new buffer, and
+ * fix up laststart and lastspace */
+ if (text[current] == breakchar[0]
+@@ -683,6 +685,7 @@
+ newtextlen += current-laststart+breakcharlen;
+ current += breakcharlen - 1;
+ laststart = lastspace = current + 1;
++ chk--;
+ }
+ /* if it is a space, check if it is at the line boundary,
+ * copy and insert a break, or just keep track of it */
+@@ -693,6 +696,7 @@
+ memcpy(newtext+newtextlen, breakchar,
breakcharlen);
+ newtextlen += breakcharlen;
+ laststart = current + 1;
++ chk--;
+ }
+ lastspace = current;
+ }
+@@ -706,6 +710,7 @@
+ memcpy(newtext+newtextlen, breakchar, breakcharlen);
+ newtextlen += breakcharlen;
+ laststart = lastspace = current;
++ chk--;
+ }
+ /* if the current word puts us over the linelength, copy
+ * back up until the last space, insert a break, and move
+@@ -717,6 +722,7 @@
+ memcpy(newtext+newtextlen, breakchar, breakcharlen);
+ newtextlen += breakcharlen;
+ laststart = lastspace = lastspace + 1;
++ chk--;
+ }
+ }
+
+@@ -727,6 +733,8 @@
+ }
+
+ newtext[newtextlen] = '\0';
++ /* free unused memory */
++ newtext = erealloc(newtext, newtextlen+1);
+
+ RETURN_STRINGL(newtext, newtextlen, 0);
+ }
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/php/php.spec
============================================================================
$ cvs diff -u -r1.26.2.1 -r1.26.2.2 php.spec
--- openpkg-src/php/php.spec 26 Aug 2002 19:54:44 -0000 1.26.2.1
+++ openpkg-src/php/php.spec 22 Jan 2003 12:22:07 -0000 1.26.2.2
@@ -37,6 +37,7 @@
# list of sources
Source0: http://www.php.net/distributions/php-%{version}.tar.gz
+Patch0: php.patch
# build information
Prefix: %{l_prefix}
@@ -54,6 +55,7 @@
%prep
%setup -q -n php-%{version}
+ %patch -p0
%build
CC="%{l_cc}" \
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]