[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pcre/pcrelib ChangeLog NEWS config.h pcre.h pcre_exec.c /ext/pcre/pcrelib/doc pcre.txt /ext/pcre/pcrelib/testdata testinput6 testinput9 testoutput6 testoutput9

2007-06-19 Thread Nuno Lopes
nlopess Tue Jun 19 17:11:30 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pcre/pcrelib   ChangeLog NEWS config.h pcre.h 
pcre_exec.c 
/php-src/ext/pcre/pcrelib/doc   pcre.txt 
/php-src/ext/pcre/pcrelib/testdata  testinput6 testinput9 
testoutput6 testoutput9 
  Log:
  final PCRE 7.2 release :-)
  http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/ChangeLog?r1=1.12.2.1.2.3&r2=1.12.2.1.2.4&diff_format=u
Index: php-src/ext/pcre/pcrelib/ChangeLog
diff -u php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.3 
php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.4
--- php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.3 Fri Jun 15 19:09:24 2007
+++ php-src/ext/pcre/pcrelib/ChangeLog  Tue Jun 19 17:11:29 2007
@@ -1,7 +1,7 @@
 ChangeLog for PCRE
 --
 
-Version 7.2 13-June-07
+Version 7.2 19-June-07
 -
 
  1. If the fr_FR locale cannot be found for test 3, try the "french" locale,
@@ -69,6 +69,9 @@
   pcrecpp::RE("a*?").FullMatch("aaa") does not, and
   pcrecpp::RE("a*?\\z").FullMatch("aaa") does again.
 
+12. If \p or \P was used in non-UTF-8 mode on a character greater than 127
+it matched the wrong number of bytes.
+
 
 Version 7.1 24-Apr-07
 -
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/NEWS?r1=1.7.2.1.2.3&r2=1.7.2.1.2.4&diff_format=u
Index: php-src/ext/pcre/pcrelib/NEWS
diff -u php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.3 
php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.4
--- php-src/ext/pcre/pcrelib/NEWS:1.7.2.1.2.3   Fri Jun 15 19:09:24 2007
+++ php-src/ext/pcre/pcrelib/NEWS   Tue Jun 19 17:11:29 2007
@@ -2,7 +2,7 @@
 
 
 
-Release 7.2 13-Jun-07
+Release 7.2 19-Jun-07
 -
 
 WARNING: saved patterns that were compiled by earlier versions of PCRE must be
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/config.h?r1=1.2.2.2&r2=1.2.2.3&diff_format=u
Index: php-src/ext/pcre/pcrelib/config.h
diff -u php-src/ext/pcre/pcrelib/config.h:1.2.2.2 
php-src/ext/pcre/pcrelib/config.h:1.2.2.3
--- php-src/ext/pcre/pcrelib/config.h:1.2.2.2   Fri Jun 15 19:09:24 2007
+++ php-src/ext/pcre/pcrelib/config.h   Tue Jun 19 17:11:29 2007
@@ -224,13 +224,13 @@
 #define PACKAGE_NAME "PCRE"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "PCRE 7.2-RC3"
+#define PACKAGE_STRING "PCRE 7.2"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "pcre"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "7.2-RC3"
+#define PACKAGE_VERSION "7.2"
 
 
 /* If you are compiling for a system other than a Unix-like system or
@@ -272,7 +272,7 @@
 
 /* Version number of package */
 #ifndef VERSION
-#define VERSION "7.2-RC3"
+#define VERSION "7.2"
 #endif
 
 /* Define to empty if `const' does not conform to ANSI C. */
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre.h?r1=1.18.2.1.2.5&r2=1.18.2.1.2.6&diff_format=u
Index: php-src/ext/pcre/pcrelib/pcre.h
diff -u php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.5 
php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.6
--- php-src/ext/pcre/pcrelib/pcre.h:1.18.2.1.2.5Fri Jun 15 19:09:24 2007
+++ php-src/ext/pcre/pcrelib/pcre.h Tue Jun 19 17:11:29 2007
@@ -43,8 +43,8 @@
 
 #define PCRE_MAJOR  7
 #define PCRE_MINOR  2
-#define PCRE_PRERELEASE -RC3
-#define PCRE_DATE   2007-06-13
+#define PCRE_PRERELEASE 
+#define PCRE_DATE   2007-06-19
 
 /* When an application links to a PCRE DLL in Windows, the symbols that are
 imported have to be identified as such. When building PCRE, the appropriate
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_exec.c?r1=1.1.2.1.2.4&r2=1.1.2.1.2.5&diff_format=u
Index: php-src/ext/pcre/pcrelib/pcre_exec.c
diff -u php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.4 
php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.5
--- php-src/ext/pcre/pcrelib/pcre_exec.c:1.1.2.1.2.4Fri Jun 15 19:09:24 2007
+++ php-src/ext/pcre/pcrelib/pcre_exec.cTue Jun 19 17:11:30 2007
@@ -2786,7 +2786,7 @@
   for (i = 1; i <= min; i++)
 {
 if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
-GETCHARINC(c, eptr);
+GETCHARINCTEST(c, eptr);
 }
   break;
 
@@ -2794,7 +2794,7 @@
   for (i = 1; i <= min; i++)
 {
 if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
-GETCHARINC(c, eptr);
+GETCHARINCTEST(c, eptr);
 prop_category = _pcre_ucp_findprop(c, &prop_chartype, 
&prop_script);
 if ((prop_chartype == ucp_Lu ||
  prop_chartype == ucp_Ll ||
@@ -2807,7 +2807,7 @@
   for (i = 1; i <= min; i++)
 {
 if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);
-GETCHARINC(c, eptr);
+GETCHARINCTEST(c, eptr);
 prop_ca

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-06-17 Thread Nuno Lopes
nlopess Sun Jun 17 19:03:58 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd.c 
  Log:
  malloc+memset == calloc (sync with libgd)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.16&r2=1.90.2.1.2.17&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.16 
php-src/ext/gd/libgd/gd.c:1.90.2.1.2.17
--- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.16 Sun Jun 17 16:51:50 2007
+++ php-src/ext/gd/libgd/gd.c   Sun Jun 17 19:03:58 2007
@@ -129,8 +129,8 @@
return NULL;
}
 
-   im = (gdImage *) gdMalloc(sizeof(gdImage));
-   memset(im, 0, sizeof(gdImage));
+   im = (gdImage *) gdCalloc(1, sizeof(gdImage));
+
/* Row-major ever since gd 1.3 */
im->pixels = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy);
im->AA_opacity = (unsigned char **) gdMalloc(sizeof(unsigned char *) * 
sy);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-06-17 Thread Nuno Lopes

On 6/15/07, Stanislav Malyshev <[EMAIL PROTECTED]> wrote:

> + pts = (char *) ecalloc(im->sy * im->sx, sizeof(char));

I don't see any overflow checks around, are you sure it's safe?


Checks are done in gdImageCreate*

--Pierre


Ah, exactly. That explains why I wasn't able to crash it :-)
Nuno

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-06-15 Thread Nuno Lopes

Ah! good point, thanks. I'll check it out.
Nuno


- Original Message - 

+ pts = (char *) ecalloc(im->sy * im->sx, sizeof(char));


I don't see any overflow checks around, are you sure it's safe?

--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gd.c

2007-06-15 Thread Nuno Lopes
nlopess Fri Jun 15 19:50:05 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd.c 
  Log:
  MFB: sync with libgd: improve _gdImageFillTiled()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.106&r2=1.107&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.106 php-src/ext/gd/libgd/gd.c:1.107
--- php-src/ext/gd/libgd/gd.c:1.106 Thu Jun 14 19:18:00 2007
+++ php-src/ext/gd/libgd/gd.c   Fri Jun 15 19:50:05 2007
@@ -1941,7 +1941,7 @@
 #define FILL_POP(Y, XL, XR, DY) \
 {sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;}
 
-void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
+static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
 
 void gdImageFill(gdImagePtr im, int x, int y, int nc)
 {
@@ -2042,16 +2042,16 @@
im->alphaBlendingFlag = alphablending_bak;  
 }
 
-void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
+static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
 {
-   int i,l, x1, x2, dy;
+   int l, x1, x2, dy;
int oc;   /* old pixel value */
int tiled;
int wx2,wy2;
/* stack of filled segments */
struct seg *stack;
struct seg *sp;
-   char **pts;
+   char *pts;
 
if (!im->tile) {
return;
@@ -2061,11 +2061,7 @@
tiled = nc==gdTiled;
 
nc =  gdImageTileGet(im,x,y);
-   pts = (char **) ecalloc(im->sy, sizeof(char*));
-
-   for (i=0; isy;i++) {
-   pts[i] = (char *) ecalloc(im->sx, sizeof(char));
-   }
+   pts = (char *) ecalloc(im->sy * im->sx, sizeof(char));
 
stack = (struct seg *)safe_emalloc(sizeof(struct seg), 
((int)(im->sy*im->sx)/4), 1);
sp = stack;
@@ -2078,9 +2074,9 @@
FILL_PUSH(y+1, x, x, -1);
while (sp>stack) {
FILL_POP(y, x1, x2, dy);
-   for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); 
x--) {
+   for (x=x1; x>=0 && (!pts[y + x*wx2] && 
gdImageGetPixel(im,x,y)==oc); x--) {
nc = gdImageTileGet(im,x,y);
-   pts[y][x]=1;
+   pts[y + x*wx2]=1;
gdImageSetPixel(im,x, y, nc);
}
if (x>=x1) {
@@ -2094,9 +2090,9 @@
}
x = x1+1;
do {
-   for (; xx2+1) {
FILL_PUSH(y, x2+1, x-1, -dy);
}
-skip:  for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, 
y)!=oc); x++);
+skip:  for (x++; x<=x2 && (pts[y + x*wx2] || 
gdImageGetPixel(im,x, y)!=oc); x++);
l = x;
} while (x<=x2);
}
-   for (i=0; isy;i++) {
-   efree(pts[i]);
-   }
+
efree(pts);
efree(stack);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-06-15 Thread Nuno Lopes
nlopess Fri Jun 15 19:47:10 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd.c 
  Log:
  sync with libgd: improve _gdImageFillTiled()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.13&r2=1.90.2.1.2.14&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.13 
php-src/ext/gd/libgd/gd.c:1.90.2.1.2.14
--- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.13 Thu Jun 14 19:17:31 2007
+++ php-src/ext/gd/libgd/gd.c   Fri Jun 15 19:47:10 2007
@@ -1943,7 +1943,7 @@
 #define FILL_POP(Y, XL, XR, DY) \
 {sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;}
 
-void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
+static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
 
 void gdImageFill(gdImagePtr im, int x, int y, int nc)
 {
@@ -2045,16 +2045,16 @@
im->alphaBlendingFlag = alphablending_bak;  
 }
 
-void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
+static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
 {
-   int i,l, x1, x2, dy;
+   int l, x1, x2, dy;
int oc;   /* old pixel value */
int tiled;
int wx2,wy2;
/* stack of filled segments */
struct seg *stack;
struct seg *sp;
-   char **pts;
+   char *pts;
 
if (!im->tile) {
return;
@@ -2064,11 +2064,7 @@
tiled = nc==gdTiled;
 
nc =  gdImageTileGet(im,x,y);
-   pts = (char **) ecalloc(im->sy, sizeof(char*));
-
-   for (i=0; isy;i++) {
-   pts[i] = (char *) ecalloc(im->sx, sizeof(char));
-   }
+   pts = (char *) ecalloc(im->sy * im->sx, sizeof(char));
 
stack = (struct seg *)safe_emalloc(sizeof(struct seg), 
((int)(im->sy*im->sx)/4), 1);
sp = stack;
@@ -2081,9 +2077,9 @@
FILL_PUSH(y+1, x, x, -1);
while (sp>stack) {
FILL_POP(y, x1, x2, dy);
-   for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); 
x--) {
+   for (x=x1; x>=0 && (!pts[y + x*wx2] && 
gdImageGetPixel(im,x,y)==oc); x--) {
nc = gdImageTileGet(im,x,y);
-   pts[y][x]=1;
+   pts[y + x*wx2]=1;
gdImageSetPixel(im,x, y, nc);
}
if (x>=x1) {
@@ -2097,9 +2093,9 @@
}
x = x1+1;
do {
-   for (; xx2+1) {
FILL_PUSH(y, x2+1, x-1, -dy);
}
-skip:  for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, 
y)!=oc); x++);
+skip:  for (x++; x<=x2 && (pts[y + x*wx2] || 
gdImageGetPixel(im,x, y)!=oc); x++);
l = x;
} while (x<=x2);
}
-   for (i=0; isy;i++) {
-   efree(pts[i]);
-   }
+
efree(pts);
efree(stack);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/pcre/tests bug41050.phpt bug41148.phpt bug41638.phpt

2007-06-15 Thread Nuno Lopes
nlopess Fri Jun 15 12:04:26 2007 UTC

  Modified files:  
/php-src/ext/pcre/tests bug41050.phpt bug41148.phpt bug41638.phpt 
  Log:
  MFB: new tests
  #they pass here, but segfault on php 5.2/pcre 7.0
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug41050.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/bug41050.phpt
diff -u /dev/null php-src/ext/pcre/tests/bug41050.phpt:1.2
--- /dev/null   Fri Jun 15 12:04:26 2007
+++ php-src/ext/pcre/tests/bug41050.phptFri Jun 15 12:04:26 2007
@@ -0,0 +1,26 @@
+--TEST--
+Bug #41050 (pcre 7.0 regression)
+--FILE--
+
+--EXPECT--
+matchedArray
+(
+[0] => SELECT * FROM #__components
+[1] => SELECT
+[2] => 
+[3] => 
+[4] => 
+[5] => 
+)
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug41148.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/bug41148.phpt
diff -u /dev/null php-src/ext/pcre/tests/bug41148.phpt:1.2
--- /dev/null   Fri Jun 15 12:04:26 2007
+++ php-src/ext/pcre/tests/bug41148.phptFri Jun 15 12:04:26 2007
@@ -0,0 +1,50 @@
+--TEST--
+Bug #41148 (pcre 7.0 regression)
+--FILE--
+";
+$ligne_horizontale = $puce = $debut_intertitre = $fin_intertitre = '';
+
+$cherche1 = array(
+/* 0 */ "/\n(+|+)/S",
+/* 1 */ "/\n-- */S",
+/* 2 */ "/\n- */S",
+/* 3 */ "/\n_ +/S",
+/* 4 */   "/(^|[^{])[{][{][{]/S",
+/* 5 */   "/[}][}][}]($|[^}])/S",
+/* 6 */ "/(( *)\n){2,}()?/S",
+/* 7 */ "/[{][{]/S",
+/* 8 */ "/[}][}]/S",
+/* 9 */ "/[{]/S",
+/* 10 */"/[}]/S",
+/* 11 */"/(){2,}/S",
+/* 12 */"/([\n]*()*)*/S",
+/* 13 */"//S",
+/* 14 */"/<\/quote>/S"
+);
+$remplace1 = array(
+/* 0 */ "\n\n$ligne_horizontale\n\n",
+/* 1 */ "\n— ",
+/* 2 */ "\n$puce ",
+/* 3 */ "\n",
+/* 4 */ "\$1\n\n$debut_intertitre",
+/* 5 */ "$fin_intertitre\n\n\$1",
+/* 6 */ "",
+/* 7 */ "",
+/* 8 */ "",
+/* 9 */ "",
+/* 10 */"",
+/* 11 */"",
+/* 12 */"",
+/* 13 */"",
+/* 14 */""
+);
+$letexte = preg_replace($cherche1, $remplace1, $letexte);
+$letexte = preg_replace("@^ @S", "", $letexte);
+
+print $letexte;
+
+?>
+--EXPECT--
+
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug41638.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/bug41638.phpt
diff -u /dev/null php-src/ext/pcre/tests/bug41638.phpt:1.2
--- /dev/null   Fri Jun 15 12:04:26 2007
+++ php-src/ext/pcre/tests/bug41638.phptFri Jun 15 12:04:26 2007
@@ -0,0 +1,82 @@
+--TEST--
+Bug #41638 (pcre 7.0 regression)
+--FILE--
+
+--EXPECT--
+Array
+(
+[0] => Array
+(
+[0] => 'loopt'
+)
+
+[1] => Array
+(
+[0] => '
+)
+
+[2] => Array
+(
+[0] => loopt
+)
+
+[3] => Array
+(
+[0] => t
+)
+
+[4] => Array
+(
+[0] => 
+)
+
+)
+Array
+(
+[0] => Array
+(
+[0] => 'loopt'
+)
+
+[1] => Array
+(
+[0] => '
+)
+
+[2] => Array
+(
+[0] => loopt
+)
+
+)
+Array
+(
+[0] => Array
+(
+[0] => 'loopt'
+)
+
+[1] => Array
+(
+[0] => '
+)
+
+[2] => Array
+(
+[0] => loopt
+)
+
+)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pcre/tests bug41050.phpt bug41148.phpt bug41638.phpt

2007-06-15 Thread Nuno Lopes
nlopess Fri Jun 15 11:57:08 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/pcre/tests bug41050.phpt bug41148.phpt bug41638.phpt 
  Log:
  add tests for pcre 7.0 regression
  update to pcre 7.2 will follow soon
  

http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug41050.phpt?view=markup&rev=1.1
Index: php-src/ext/pcre/tests/bug41050.phpt
+++ php-src/ext/pcre/tests/bug41050.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug41148.phpt?view=markup&rev=1.1
Index: php-src/ext/pcre/tests/bug41148.phpt
+++ php-src/ext/pcre/tests/bug41148.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug41638.phpt?view=markup&rev=1.1
Index: php-src/ext/pcre/tests/bug41638.phpt
+++ php-src/ext/pcre/tests/bug41638.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / .cvsignore

2007-06-12 Thread Nuno Lopes
nlopess Tue Jun 12 14:54:14 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src.cvsignore 
  Log:
  ignore tmp-php.ini
  
http://cvs.php.net/viewvc.cgi/php-src/.cvsignore?r1=1.51.4.1&r2=1.51.4.2&diff_format=u
Index: php-src/.cvsignore
diff -u php-src/.cvsignore:1.51.4.1 php-src/.cvsignore:1.51.4.2
--- php-src/.cvsignore:1.51.4.1 Tue Jun 13 22:02:57 2006
+++ php-src/.cvsignore  Tue Jun 12 14:54:14 2007
@@ -69,3 +69,4 @@
 lcov_data
 lcov_html
 php_lcov.info
+tmp-php.ini

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / .cvsignore

2007-06-12 Thread Nuno Lopes
nlopess Tue Jun 12 14:53:10 2007 UTC

  Modified files:  
/php-src.cvsignore 
  Log:
  ignore tmp-php.ini
  
http://cvs.php.net/viewvc.cgi/php-src/.cvsignore?r1=1.52&r2=1.53&diff_format=u
Index: php-src/.cvsignore
diff -u php-src/.cvsignore:1.52 php-src/.cvsignore:1.53
--- php-src/.cvsignore:1.52 Tue Nov  8 16:43:09 2005
+++ php-src/.cvsignore  Tue Jun 12 14:53:10 2007
@@ -69,4 +69,4 @@
 php_lcov.info
 lcov_data
 lcov_html
-
+tmp-php.ini

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard url_scanner_ex.c

2007-06-06 Thread Nuno Lopes

yep. letting 'make' regenerate the files should do the trick.
Thanks,
Nuno

- Original Message - 

I guess you need to generate the files the "correct way" :)
It should happen automatically when you do the test build..? :D
(just don't run re2c manually)

--Jani

Antony Dovgal kirjoitti:

On 06.06.2007 20:00, Ilia Alshanetsky wrote:

Nuno,

What does the gcov build need that my re2c is not doing so that I can  
fix it for the future.


Apparently it needs full path, not just filename.


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard url_scanner_ex.c

2007-06-06 Thread Nuno Lopes
nlopess Wed Jun  6 12:29:06 2007 UTC

  Modified files:  
/php-src/ext/standard   url_scanner_ex.c 
  Log:
  fix gcov build..
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url_scanner_ex.c?r1=1.105&r2=1.106&diff_format=u
Index: php-src/ext/standard/url_scanner_ex.c
diff -u php-src/ext/standard/url_scanner_ex.c:1.105 
php-src/ext/standard/url_scanner_ex.c:1.106
--- php-src/ext/standard/url_scanner_ex.c:1.105 Wed Jun  6 00:01:13 2007
+++ php-src/ext/standard/url_scanner_ex.c   Wed Jun  6 12:29:06 2007
@@ -1,5 +1,5 @@
 /* Generated by re2c 0.11.0 on Tue Jun  5 20:00:54 2007 */
-#line 1 "url_scanner_ex.re"
+#line 1 "ext/standard/url_scanner_ex.re"
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: url_scanner_ex.c,v 1.105 2007/06/06 00:01:13 iliaa Exp $ */
+/* $Id: url_scanner_ex.c,v 1.106 2007/06/06 12:29:06 nlopess Exp $ */
 
 #include "php.h"
 
@@ -91,7 +91,7 @@
STD_PHP_INI_ENTRY("url_rewriter.tags", 
"a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, 
url_adapt_state_ex, php_basic_globals, basic_globals)
 PHP_INI_END()
 
-#line 98 "url_scanner_ex.re"
+#line 98 "ext/standard/url_scanner_ex.re"
 
 
 #define YYFILL(n) goto done
@@ -145,7 +145,7 @@
128, 128, 128, 128, 128, 128, 128, 128, 
};
 
-#line 149 "url_scanner_ex.c"
+#line 149 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
 
@@ -157,19 +157,19 @@
if(yych <= '9') goto yy6;
if(yych >= ';') goto yy4;
++YYCURSOR;
-#line 116 "url_scanner_ex.re"
+#line 116 "ext/standard/url_scanner_ex.re"
{ smart_str_append(dest, url); return; }
-#line 163 "url_scanner_ex.c"
+#line 163 "ext/standard/url_scanner_ex.c"
 yy4:
++YYCURSOR;
-#line 117 "url_scanner_ex.re"
+#line 117 "ext/standard/url_scanner_ex.re"
{ sep = separator; goto scan; }
-#line 168 "url_scanner_ex.c"
+#line 168 "ext/standard/url_scanner_ex.c"
 yy6:
++YYCURSOR;
-#line 118 "url_scanner_ex.re"
+#line 118 "ext/standard/url_scanner_ex.re"
{ bash = p - 1; goto done; }
-#line 173 "url_scanner_ex.c"
+#line 173 "ext/standard/url_scanner_ex.c"
 yy8:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -177,12 +177,12 @@
if(yybm[0+yych] & 128) {
goto yy8;
}
-#line 119 "url_scanner_ex.re"
+#line 119 "ext/standard/url_scanner_ex.re"
{ goto scan; }
-#line 183 "url_scanner_ex.c"
+#line 183 "ext/standard/url_scanner_ex.c"
}
 }
-#line 120 "url_scanner_ex.re"
+#line 120 "ext/standard/url_scanner_ex.re"
 
 done:

@@ -386,7 +386,7 @@
128, 128, 128, 128, 128, 128, 128, 128, 
};
 
-#line 390 "url_scanner_ex.c"
+#line 390 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -395,9 +395,9 @@
goto yy15;
}
++YYCURSOR;
-#line 288 "url_scanner_ex.re"
+#line 288 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
-#line 401 "url_scanner_ex.c"
+#line 401 "ext/standard/url_scanner_ex.c"
 yy15:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -405,12 +405,12 @@
if(yybm[0+yych] & 128) {
goto yy15;
}
-#line 289 "url_scanner_ex.re"
+#line 289 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain; }
-#line 411 "url_scanner_ex.c"
+#line 411 "ext/standard/url_scanner_ex.c"
}
 }
-#line 290 "url_scanner_ex.re"
+#line 290 "ext/standard/url_scanner_ex.re"
 
 
 state_tag: 
@@ -451,7 +451,7 @@
  0,   0,   0,   0,   0,   0,   0,   0, 
};
 
-#line 455 "url_scanner_ex.c"
+#line 455 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -468,14 +468,14 @@
yych = *YYCURSOR;
goto yy25;
 yy21:
-#line 295 "url_scanner_ex.re"
+#line 295 "ext/standard/url_scanner_ex.re"
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); 
if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
-#line 474 "url_scanner_ex.c"
+#line 474 "ext/standard/url_scanner_ex.c"
 yy22:
++YYCURSOR;
-#line 296 "url_scanner_ex.re"
+#line 296 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
-#line 479 "url_scanner_ex.c"
+#line 479 "ext/standard/url_scanner_ex.c"
 yy24:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -487,7 +

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard url_scanner_ex.c

2007-06-06 Thread Nuno Lopes
nlopess Wed Jun  6 12:27:24 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   url_scanner_ex.c 
  Log:
  fix gcov build for the 100th time..
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url_scanner_ex.c?r1=1.95.2.4.2.2&r2=1.95.2.4.2.3&diff_format=u
Index: php-src/ext/standard/url_scanner_ex.c
diff -u php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.2 
php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.3
--- php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.2  Wed Jun  6 00:00:27 2007
+++ php-src/ext/standard/url_scanner_ex.c   Wed Jun  6 12:27:24 2007
@@ -1,5 +1,5 @@
 /* Generated by re2c 0.11.0 on Tue Jun  5 19:51:02 2007 */
-#line 1 "url_scanner_ex.re"
+#line 1 "ext/standard/url_scanner_ex.re"
 /*
   +--+
   | PHP Version 5|
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: url_scanner_ex.c,v 1.95.2.4.2.2 2007/06/06 00:00:27 iliaa Exp $ */
+/* $Id: url_scanner_ex.c,v 1.95.2.4.2.3 2007/06/06 12:27:24 nlopess Exp $ */
 
 #include "php.h"
 
@@ -91,7 +91,7 @@
STD_PHP_INI_ENTRY("url_rewriter.tags", 
"a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, 
url_adapt_state_ex, php_basic_globals, basic_globals)
 PHP_INI_END()
 
-#line 98 "url_scanner_ex.re"
+#line 98 "ext/standard/url_scanner_ex.re"
 
 
 #define YYFILL(n) goto done
@@ -145,7 +145,7 @@
128, 128, 128, 128, 128, 128, 128, 128, 
};
 
-#line 149 "url_scanner_ex.c"
+#line 149 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
 
@@ -157,19 +157,19 @@
if(yych <= '9') goto yy6;
if(yych >= ';') goto yy4;
++YYCURSOR;
-#line 116 "url_scanner_ex.re"
+#line 116 "ext/standard/url_scanner_ex.re"
{ smart_str_append(dest, url); return; }
-#line 163 "url_scanner_ex.c"
+#line 163 "ext/standard/url_scanner_ex.c"
 yy4:
++YYCURSOR;
-#line 117 "url_scanner_ex.re"
+#line 117 "ext/standard/url_scanner_ex.re"
{ sep = separator; goto scan; }
-#line 168 "url_scanner_ex.c"
+#line 168 "ext/standard/url_scanner_ex.c"
 yy6:
++YYCURSOR;
-#line 118 "url_scanner_ex.re"
+#line 118 "ext/standard/url_scanner_ex.re"
{ bash = p - 1; goto done; }
-#line 173 "url_scanner_ex.c"
+#line 173 "ext/standard/url_scanner_ex.c"
 yy8:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -177,12 +177,12 @@
if(yybm[0+yych] & 128) {
goto yy8;
}
-#line 119 "url_scanner_ex.re"
+#line 119 "ext/standard/url_scanner_ex.re"
{ goto scan; }
-#line 183 "url_scanner_ex.c"
+#line 183 "ext/standard/url_scanner_ex.c"
}
 }
-#line 120 "url_scanner_ex.re"
+#line 120 "ext/standard/url_scanner_ex.re"
 
 done:

@@ -386,7 +386,7 @@
128, 128, 128, 128, 128, 128, 128, 128, 
};
 
-#line 390 "url_scanner_ex.c"
+#line 390 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -395,9 +395,9 @@
goto yy15;
}
++YYCURSOR;
-#line 288 "url_scanner_ex.re"
+#line 288 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
-#line 401 "url_scanner_ex.c"
+#line 401 "ext/standard/url_scanner_ex.c"
 yy15:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -405,12 +405,12 @@
if(yybm[0+yych] & 128) {
goto yy15;
}
-#line 289 "url_scanner_ex.re"
+#line 289 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain; }
-#line 411 "url_scanner_ex.c"
+#line 411 "ext/standard/url_scanner_ex.c"
}
 }
-#line 290 "url_scanner_ex.re"
+#line 290 "ext/standard/url_scanner_ex.re"
 
 
 state_tag: 
@@ -451,7 +451,7 @@
  0,   0,   0,   0,   0,   0,   0,   0, 
};
 
-#line 455 "url_scanner_ex.c"
+#line 455 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -468,14 +468,14 @@
yych = *YYCURSOR;
goto yy25;
 yy21:
-#line 295 "url_scanner_ex.re"
+#line 295 "ext/standard/url_scanner_ex.re"
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); 
if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
-#line 474 "url_scanner_ex.c"
+#line 474 "ext/standard/url_scanner_ex.c"
 yy22:
++YYCURSOR;
-#line 296 "url_scanner_ex.re"
+#line 296 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
-#line 479 "url_scanner_ex.c"
+#line 479 "ext/standard/url_scanner_ex.c"
 yy24:

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_mysql .cvsignore /ext/pdo_oci .cvsignore /ext/pdo_pgsql .cvsignore

2007-06-04 Thread Nuno Lopes
nlopess Mon Jun  4 18:13:53 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_mysql  .cvsignore 
/php-src/ext/pdo_oci.cvsignore 
/php-src/ext/pdo_pgsql  .cvsignore 
  Log:
  ignore *.gcno
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/.cvsignore?r1=1.2&r2=1.2.4.1&diff_format=u
Index: php-src/ext/pdo_mysql/.cvsignore
diff -u php-src/ext/pdo_mysql/.cvsignore:1.2 
php-src/ext/pdo_mysql/.cvsignore:1.2.4.1
--- php-src/ext/pdo_mysql/.cvsignore:1.2Tue Jun 14 13:26:09 2005
+++ php-src/ext/pdo_mysql/.cvsignoreMon Jun  4 18:13:53 2007
@@ -1,4 +1,5 @@
 .deps
+*.gcno
 *.lo
 *.la
 .*.swp
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/.cvsignore?r1=1.3&r2=1.3.4.1&diff_format=u
Index: php-src/ext/pdo_oci/.cvsignore
diff -u php-src/ext/pdo_oci/.cvsignore:1.3 
php-src/ext/pdo_oci/.cvsignore:1.3.4.1
--- php-src/ext/pdo_oci/.cvsignore:1.3  Tue Jun 14 13:26:09 2005
+++ php-src/ext/pdo_oci/.cvsignore  Mon Jun  4 18:13:53 2007
@@ -1,4 +1,5 @@
 .deps
+*.gcno
 *.lo
 *.la
 .*.swp
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/.cvsignore?r1=1.2&r2=1.2.4.1&diff_format=u
Index: php-src/ext/pdo_pgsql/.cvsignore
diff -u php-src/ext/pdo_pgsql/.cvsignore:1.2 
php-src/ext/pdo_pgsql/.cvsignore:1.2.4.1
--- php-src/ext/pdo_pgsql/.cvsignore:1.2Tue Jun 14 13:26:09 2005
+++ php-src/ext/pdo_pgsql/.cvsignoreMon Jun  4 18:13:53 2007
@@ -1,4 +1,5 @@
 .deps
+*.gcno
 *.lo
 *.la
 .*.swp

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/filter .cvsignore /ext/pdo .cvsignore /ext/pdo_mysql .cvsignore /ext/pdo_oci .cvsignore /ext/pdo_pgsql .cvsignore /ext/pdo_sqlite .cvsignore /ext/unicode .cvsignore

2007-06-04 Thread Nuno Lopes
nlopess Mon Jun  4 18:11:38 2007 UTC

  Modified files:  
/php-src/ext/filter .cvsignore 
/php-src/ext/pdo.cvsignore 
/php-src/ext/pdo_mysql  .cvsignore 
/php-src/ext/pdo_oci.cvsignore 
/php-src/ext/pdo_pgsql  .cvsignore 
/php-src/ext/pdo_sqlite .cvsignore 
/php-src/ext/unicode.cvsignore 
/php-src/ext/xmlreader  .cvsignore 
/php-src/ext/xmlwriter  .cvsignore 
/php-src/ext/zip.cvsignore 
/php-src/ext/zip/lib.cvsignore 
  Log:
  ignore *.gcno
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/.cvsignore?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/filter/.cvsignore
diff -u php-src/ext/filter/.cvsignore:1.1 php-src/ext/filter/.cvsignore:1.2
--- php-src/ext/filter/.cvsignore:1.1   Tue Sep  6 18:46:37 2005
+++ php-src/ext/filter/.cvsignore   Mon Jun  4 18:11:38 2007
@@ -1,3 +1,4 @@
+*.gcno
 .deps
 Makefile
 *.lo
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/.cvsignore?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/pdo/.cvsignore
diff -u php-src/ext/pdo/.cvsignore:1.5 php-src/ext/pdo/.cvsignore:1.6
--- php-src/ext/pdo/.cvsignore:1.5  Wed Apr 25 07:47:15 2007
+++ php-src/ext/pdo/.cvsignore  Mon Jun  4 18:11:38 2007
@@ -1,4 +1,5 @@
 .deps
+*.gcno
 *.lo
 *.la
 .*.swp
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/.cvsignore?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/pdo_mysql/.cvsignore
diff -u php-src/ext/pdo_mysql/.cvsignore:1.2 
php-src/ext/pdo_mysql/.cvsignore:1.3
--- php-src/ext/pdo_mysql/.cvsignore:1.2Tue Jun 14 13:26:09 2005
+++ php-src/ext/pdo_mysql/.cvsignoreMon Jun  4 18:11:38 2007
@@ -1,4 +1,5 @@
 .deps
+*.gcno
 *.lo
 *.la
 .*.swp
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/.cvsignore?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/pdo_oci/.cvsignore
diff -u php-src/ext/pdo_oci/.cvsignore:1.3 php-src/ext/pdo_oci/.cvsignore:1.4
--- php-src/ext/pdo_oci/.cvsignore:1.3  Tue Jun 14 13:26:09 2005
+++ php-src/ext/pdo_oci/.cvsignore  Mon Jun  4 18:11:38 2007
@@ -1,4 +1,5 @@
 .deps
+*.gcno
 *.lo
 *.la
 .*.swp
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/.cvsignore?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/pdo_pgsql/.cvsignore
diff -u php-src/ext/pdo_pgsql/.cvsignore:1.2 
php-src/ext/pdo_pgsql/.cvsignore:1.3
--- php-src/ext/pdo_pgsql/.cvsignore:1.2Tue Jun 14 13:26:09 2005
+++ php-src/ext/pdo_pgsql/.cvsignoreMon Jun  4 18:11:38 2007
@@ -1,3 +1,4 @@
+*.gcno
 .deps
 *.lo
 *.la
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/.cvsignore?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/pdo_sqlite/.cvsignore
diff -u php-src/ext/pdo_sqlite/.cvsignore:1.5 
php-src/ext/pdo_sqlite/.cvsignore:1.6
--- php-src/ext/pdo_sqlite/.cvsignore:1.5   Sat Sep 24 14:22:02 2005
+++ php-src/ext/pdo_sqlite/.cvsignore   Mon Jun  4 18:11:38 2007
@@ -1,3 +1,4 @@
+*.gcno
 .deps
 *.lo
 *.la
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/.cvsignore?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/unicode/.cvsignore
diff -u php-src/ext/unicode/.cvsignore:1.1 php-src/ext/unicode/.cvsignore:1.2
--- php-src/ext/unicode/.cvsignore:1.1  Thu Aug 11 23:36:01 2005
+++ php-src/ext/unicode/.cvsignore  Mon Jun  4 18:11:38 2007
@@ -1,3 +1,4 @@
+*.gcno
 *.lo
 *.la
 .deps
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlreader/.cvsignore?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/xmlreader/.cvsignore
diff -u php-src/ext/xmlreader/.cvsignore:1.1 
php-src/ext/xmlreader/.cvsignore:1.2
--- php-src/ext/xmlreader/.cvsignore:1.1Mon Apr 19 18:55:02 2004
+++ php-src/ext/xmlreader/.cvsignoreMon Jun  4 18:11:38 2007
@@ -1,4 +1,5 @@
 #*#
+*.gcno
 *.dsw
 *.la
 *.lo
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlwriter/.cvsignore?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/xmlwriter/.cvsignore
diff -u php-src/ext/xmlwriter/.cvsignore:1.1 
php-src/ext/xmlwriter/.cvsignore:1.2
--- php-src/ext/xmlwriter/.cvsignore:1.1Tue Jul 13 17:01:30 2004
+++ php-src/ext/xmlwriter/.cvsignoreMon Jun  4 18:11:38 2007
@@ -1,4 +1,5 @@
 #*#
+*.gcno
 *.dsw
 *.la
 *.lo
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/.cvsignore?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/zip/.cvsignore
diff -u php-src/ext/zip/.cvsignore:1.8 php-src/ext/zip/.cvsignore:1.9
--- php-src/ext/zip/.cvsignore:1.8  Fri Nov  3 16:12:18 2006
+++ php-src/ext/zip/.cvsignore  Mon Jun  4 18:11:38 2007
@@ -1,2 +1,3 @@
 *.lo
 .libs
+*.gcno
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/.cvsignore?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/zip/lib/.cvsignore
diff -u php-src/ext/zip/lib/.cvsignore:1.1 php-src/ext/zip/lib/.cvsignore:1.2
--- php-src/ext/zip/lib/.cvsignore:1.1  Sun Sep 10 14:02:14 2006
+++ php-src/ext/zip/lib/.cvsignore  Mon Jun  4 18:11:38 2007
@@ -1 +1,2 @@
 *.lo
+*.gcno

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard html.c /ext/standard/tests/strings htmlentities18.phpt

2007-05-27 Thread Nuno Lopes
nlopess Sun May 27 15:57:11 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   html.c 
/php-src/ext/standard/tests/strings htmlentities18.phpt 
  Log:
  fix handling of && by htmlentities 'no-double-encode'
  expand the test cases
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.13&r2=1.111.2.2.2.14&diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.13 
php-src/ext/standard/html.c:1.111.2.2.2.14
--- php-src/ext/standard/html.c:1.111.2.2.2.13  Sun May 27 15:45:18 2007
+++ php-src/ext/standard/html.c Sun May 27 15:57:11 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.111.2.2.2.13 2007/05/27 15:45:18 nlopess Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.14 2007/05/27 15:57:11 nlopess Exp $ */
 
 /*
  * HTML entity resources:
@@ -1154,7 +1154,7 @@
len += sizeof("&") - 1;
} else {
char *e = memchr(old + i, ';', oldlen - 
i);
-   char *s = old + i + 1;
+   char *s = old + i;
 
if (!e || (e - s) > 10) { /* minor 
optimization to avoid "entities" over 10 chars in length */
goto encode_amp;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities18.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/standard/tests/strings/htmlentities18.phpt
diff -u php-src/ext/standard/tests/strings/htmlentities18.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/htmlentities18.phpt:1.1.2.2
--- php-src/ext/standard/tests/strings/htmlentities18.phpt:1.1.2.1  Tue May 
22 12:37:00 2007
+++ php-src/ext/standard/tests/strings/htmlentities18.phpt  Sun May 27 
15:57:11 2007
@@ -9,6 +9,9 @@
"&; & &#a; &9;",
"&kffjadfdhsjfhjasdhffasdfas;",
"�",
+   "&",
+   "&&&",
+   "&ab&&",
 );
 
 foreach ($tests as $test) {
@@ -23,9 +26,15 @@
 string(13) "abc&sfdsa"
 string(33) "test+s & some more D"
 string(33) "test+s & some more D"
-string(20) "&; & &#a; &9;"
-string(20) "&; & &#a; &9;"
+string(24) "&; & &#a; &9;"
+string(24) "&; & &#a; &9;"
 string(32) "&kffjadfdhsjfhjasdhffasdfas;"
 string(32) "&kffjadfdhsjfhjasdhffasdfas;"
 string(16) "�"
 string(16) "�"
+string(5) "&"
+string(5) "&"
+string(15) "&&&"
+string(15) "&&&"
+string(17) "&ab&&"
+string(17) "&ab&&"

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard html.c

2007-05-27 Thread Nuno Lopes
nlopess Sun May 27 15:45:18 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   html.c 
  Log:
  fix the new 'no-double-encoding' feature of htmlspecialchars()  (the length 
for char search was wrong. this could lead to crashes..)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.12&r2=1.111.2.2.2.13&diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.12 
php-src/ext/standard/html.c:1.111.2.2.2.13
--- php-src/ext/standard/html.c:1.111.2.2.2.12  Fri May 25 14:09:02 2007
+++ php-src/ext/standard/html.c Sun May 27 15:45:18 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.111.2.2.2.12 2007/05/25 14:09:02 bjori Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.13 2007/05/27 15:45:18 nlopess Exp $ */
 
 /*
  * HTML entity resources:
@@ -1153,7 +1153,7 @@
memcpy(replaced + len, "&", 
sizeof("&") - 1);
len += sizeof("&") - 1;
} else {
-   char *e = memchr(old + i, ';', len - i);
+   char *e = memchr(old + i, ';', oldlen - 
i);
char *s = old + i + 1;
 
if (!e || (e - s) > 10) { /* minor 
optimization to avoid "entities" over 10 chars in length */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard md5.c

2007-05-27 Thread Nuno Lopes
nlopess Sun May 27 15:29:39 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   md5.c 
  Log:
  make make_digest() output a 16-byte string so that it wont break the internal 
PHP API (it was breaking the SOAP extension)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/md5.c?r1=1.39.2.1.2.3&r2=1.39.2.1.2.4&diff_format=u
Index: php-src/ext/standard/md5.c
diff -u php-src/ext/standard/md5.c:1.39.2.1.2.3 
php-src/ext/standard/md5.c:1.39.2.1.2.4
--- php-src/ext/standard/md5.c:1.39.2.1.2.3 Sun May 27 14:50:09 2007
+++ php-src/ext/standard/md5.c  Sun May 27 15:29:38 2007
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: md5.c,v 1.39.2.1.2.3 2007/05/27 14:50:09 sniper Exp $ */
+/* $Id: md5.c,v 1.39.2.1.2.4 2007/05/27 15:29:38 nlopess Exp $ */
 
 /* 
  * md5.c - Copyright 1997 Lachlan Roche 
@@ -28,7 +28,7 @@
 
 PHPAPI void make_digest(char *md5str, unsigned char *digest)
 {
-   make_digest_ex(md5str, digest, strlen(digest));
+   make_digest_ex(md5str, digest, 16);
 }
 
 PHPAPI void make_digest_ex(char *md5str, unsigned char *digest, int len)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_sqlite/sqlite/src parse.c

2007-05-17 Thread Nuno Lopes
nlopess Thu May 17 17:57:52 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_sqlite/sqlite/src  parse.c 
  Log:
  fix gcov build...
  http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite/src/parse.c?r1=1.6.2.5.2.9&r2=1.6.2.5.2.10&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite/src/parse.c
diff -u php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.9 
php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.10
--- php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.9   Wed May 16 
21:04:46 2007
+++ php-src/ext/pdo_sqlite/sqlite/src/parse.c   Thu May 17 17:57:51 2007
@@ -4,7 +4,7 @@
 /* First off, code is include which follows the "include" declaration
 ** in the input file. */
 #include 
-#line 56 "parse.y"
+#line 56 "ext/pdo_sqlite/sqlite/src/parse.y"
 
 #include "sqliteInt.h"
 #include "parse.h"
@@ -43,7 +43,7 @@
 */
 struct AttachKey { int type;  Token key; };
 
-#line 48 "parse.c"
+#line 48 "ext/pdo_sqlite/sqlite/src/parse.c"
 /* Next is all token values, in a form suitable for use by makeheaders.
 ** This section will be null unless lemon is run with the -m switch.
 */
@@ -1267,9 +1267,9 @@
 case 155:
 case 189:
 case 206:
-#line 374 "parse.y"
+#line 374 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SelectDelete((yypminor->yy219));}
-#line 1274 "parse.c"
+#line 1274 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 169:
 case 170:
@@ -1282,9 +1282,9 @@
 case 222:
 case 223:
 case 235:
-#line 623 "parse.y"
+#line 623 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy172));}
-#line 1289 "parse.c"
+#line 1289 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 174:
 case 182:
@@ -1297,40 +1297,40 @@
 case 212:
 case 215:
 case 221:
-#line 863 "parse.y"
+#line 863 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprListDelete((yypminor->yy174));}
-#line 1304 "parse.c"
+#line 1304 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 188:
 case 193:
 case 201:
 case 202:
-#line 487 "parse.y"
+#line 487 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SrcListDelete((yypminor->yy373));}
-#line 1312 "parse.c"
+#line 1312 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 205:
 case 208:
 case 214:
-#line 504 "parse.y"
+#line 504 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy432));}
-#line 1319 "parse.c"
+#line 1319 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 231:
 case 236:
-#line 964 "parse.y"
+#line 964 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3DeleteTriggerStep((yypminor->yy243));}
-#line 1325 "parse.c"
+#line 1325 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 233:
-#line 950 "parse.y"
+#line 950 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy370).b);}
-#line 1330 "parse.c"
+#line 1330 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 238:
-#line 1037 "parse.y"
+#line 1037 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy386));}
-#line 1335 "parse.c"
+#line 1335 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 default:  break;   /* If no destructor action specified: do nothing */
   }
@@ -1489,11 +1489,11 @@
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will execute if the parser
** stack every overflows */
-#line 44 "parse.y"
+#line 44 "ext/pdo_sqlite/sqlite/src/parse.y"
 
   sqlite3ErrorMsg(pParse, "parser stack overflow");
   pParse->parseError = 1;
-#line 1499 "parse.c"
+#line 1499 "ext/pdo_sqlite/sqlite/src/parse.c"
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument 
var */
 }
 
@@ -1944,67 +1944,67 @@
   case 303:
   case 305:
   case 309:
-#line 97 "parse.y"
+#line 97 "ext/pdo_sqlite/sqlite/src/parse.y"
 {
 }
-#line 1953 "parse.c"
+#line 1953 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 3:
-#line 100 "parse.y"
+#line 100 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3FinishCoding(pParse); }
-#line 1958 "parse.c"
+#line 1958 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 6:
-#line 103 "parse.y"
+#line 103 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 0); }
-#line 1963 "parse.c"
+#line 1963 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 7:
-#line 105 "parse.y"
+#line 105 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 1); }
-#line 1968 "parse.c"
+#line 1968 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 8:
-#line 106 "parse.y"
+#line 106 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 2); }
-#line 1973 "parse.c"
+#line 1973 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 9:
-#line 112 "parse.y"
+#line 112 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy46);}
-#line 1978 "parse.c"
+#line 1978 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 13

Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/mysql php_mysql.c

2007-05-14 Thread Nuno Lopes

Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.701 php-src/NEWS:1.2027.2.547.2.702
--- php-src/NEWS:1.2027.2.547.2.701 Mon May 14 17:10:46 2007
+++ php-src/NEWS Mon May 14 18:09:19 2007
@@ -1,7 +1,7 @@
PHP 
NEWS

|||
?? ??? 2007, PHP 5.2.3
-- Added function mysql_set_charset(). Allows connection encoding to be 
altered
+- [DOC] Added function mysql_set_charset(). Allows connection encoding to 
be altered


well the [DOC] tag is supposed to be used in the cvs commit log and not in 
the NEWS files, so that the commit message is forwarded automatically to the 
doc team.


Thanks,
Nuno 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /main php_compat.h

2007-05-07 Thread Nuno Lopes
nlopess Mon May  7 15:43:21 2007 UTC

  Modified files:  
/php-src/main   php_compat.h 
  Log:
  update pcre symbols list
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.32&r2=1.33&diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.32 php-src/main/php_compat.h:1.33
--- php-src/main/php_compat.h:1.32  Sun Feb 25 18:48:19 2007
+++ php-src/main/php_compat.h   Mon May  7 15:43:21 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_compat.h,v 1.32 2007/02/25 18:48:19 nlopess Exp $ */
+/* $Id: php_compat.h,v 1.33 2007/05/07 15:43:21 nlopess Exp $ */
 
 #ifndef PHP_COMPAT_H
 #define PHP_COMPAT_H
@@ -56,8 +56,7 @@
 #define _pcre_xclass   php__pcre_xclass
 #define pcre_callout   php_pcre_callout
 #define _pcre_OP_lengths   php__pcre_OP_lengths
-/* this one doesn't work because pcre.h isn't included from the 
pcre_chartables.c file
-#define _pcre_default_tables   php__pcre_default_tables */
+#define _pcre_default_tables   php__pcre_default_tables
 #define pcre_get_stringtable_entries   php_pcre_get_stringtable_entries
 #define _pcre_is_newline   php__pcre_is_newline
 #define pcre_stack_freephp_pcre_stack_free

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/pcre/tests bug21758.phpt

2007-05-07 Thread Nuno Lopes
nlopess Mon May  7 15:24:37 2007 UTC

  Modified files:  
/php-src/ext/pcre/tests bug21758.phpt 
  Log:
  fix test title
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug21758.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/pcre/tests/bug21758.phpt
diff -u php-src/ext/pcre/tests/bug21758.phpt:1.2 
php-src/ext/pcre/tests/bug21758.phpt:1.3
--- php-src/ext/pcre/tests/bug21758.phpt:1.2Fri Dec  8 12:15:21 2006
+++ php-src/ext/pcre/tests/bug21758.phptMon May  7 15:24:37 2007
@@ -1,5 +1,5 @@
 --TEST--
-Bug #27011: preg_replace_callback() not working with class methods
+Bug #21758: preg_replace_callback() not working with class methods
 --FILE--
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pcre/tests bug21758.phpt

2007-05-07 Thread Nuno Lopes
nlopess Mon May  7 15:23:53 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pcre/tests bug21758.phpt 
  Log:
  fix test title
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug21758.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/pcre/tests/bug21758.phpt
diff -u php-src/ext/pcre/tests/bug21758.phpt:1.1.2.1 
php-src/ext/pcre/tests/bug21758.phpt:1.1.2.2
--- php-src/ext/pcre/tests/bug21758.phpt:1.1.2.1Fri Dec  8 12:13:23 2006
+++ php-src/ext/pcre/tests/bug21758.phptMon May  7 15:23:53 2007
@@ -1,5 +1,5 @@
 --TEST--
-Bug #27011: preg_replace_callback() not working with class methods
+Bug #21758: preg_replace_callback() not working with class methods
 --FILE--
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c /ext/tidy/tests 007.phpt

2007-05-04 Thread Nuno Lopes
nlopess Fri May  4 17:45:56 2007 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
/php-src/ext/tidy/tests 007.phpt 
  Log:
  use the new 's&' parameter type and simplify the code
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.112&r2=1.113&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.112 php-src/ext/tidy/tidy.c:1.113
--- php-src/ext/tidy/tidy.c:1.112   Thu Feb  8 16:37:52 2007
+++ php-src/ext/tidy/tidy.c Fri May  4 17:45:56 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.112 2007/02/08 16:37:52 nlopess Exp $ */
+/* $Id: tidy.c,v 1.113 2007/05/04 17:45:56 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1056,7 +1056,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.112 2007/02/08 16:37:52 nlopess Exp 
$)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.113 2007/05/04 17:45:56 nlopess Exp 
$)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1173,38 +1173,27 @@
Parse a document stored in a string */
 static PHP_FUNCTION(tidy_parse_string)
 {
-   zstr input, enc = NULL_ZSTR;
-   zend_uchar input_type, enc_type = IS_STRING;
+   zstr input;
+   char *enc = NULL;
+   zend_uchar input_type;
int input_len, enc_len;
zval **options = NULL;
PHPTidyObj *obj;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|Zt", &input, 
&input_len, &input_type, &options, &enc, &enc_len, &enc_type) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t|Zs&", &input, 
&input_len, &input_type, &options, &enc, &enc_len, UG(ascii_conv)) == FAILURE) {
RETURN_FALSE;
}
 
-   if (enc_type != IS_STRING) {
-   enc.s = zend_unicode_to_ascii(enc.u, enc_len TSRMLS_CC);
-   if (!enc.s) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or 
ASCII-Unicode string expected, non-ASCII-Unicode string received");
-   RETURN_FALSE;
-   }
-   }
-
tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC);
obj = (PHPTidyObj *) zend_object_store_get_object(return_value 
TSRMLS_CC);
 
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
 
-   if (php_tidy_parse_string(obj, input.s, input_len, enc.s TSRMLS_CC) == 
FAILURE) {
+   if (php_tidy_parse_string(obj, input.s, input_len, enc TSRMLS_CC) == 
FAILURE) {
zval_dtor(return_value);
INIT_ZVAL(*return_value);
RETVAL_FALSE;
}
-
-   if (enc_type != IS_STRING) {
-   efree(enc.s);
-   }
 }
 /* }}} */
 
@@ -1339,48 +1328,31 @@
 static PHP_FUNCTION(tidy_get_opt_doc)
 {
PHPTidyObj *obj;
-   char *optval;
-   zstr optname;
-   zend_uchar optname_type;
+   char *optval, *optname;
int optname_len;
TidyOption opt;
 
TIDY_SET_CONTEXT;
 
if (object) {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", 
&optname, &optname_len, &optname_type) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&", 
&optname, &optname_len, UG(ascii_conv)) == FAILURE) {
RETURN_FALSE;
}
} else {
-   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
NULL, "Ot", &object, tidy_ce_doc, &optname, &optname_len, &optname_type) == 
FAILURE) {
-   RETURN_FALSE;
-   }
-   }
-
-   if (optname_type != IS_STRING) {
-   optname.s = zend_unicode_to_ascii(optname.u, optname_len 
TSRMLS_CC);
-   if (!optname.s) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or 
ASCII-Unicode string expected, non-ASCII-Unicode string received");
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
NULL, "Os&", &object, tidy_ce_doc, &optname, &optname_len, UG(ascii_conv)) == 
FAILURE) {
RETURN_FALSE;
}
}
 
obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC);
 
-   opt = tidyGetOptionByName(obj->ptdoc->doc, optname.s);
+   opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
 
if (!opt) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy 
Configuration Option '%s'", optname.s);
-   if (optname_type != IS_STRING) {
-   efree(optname.s);
-   }
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy 
Configuration Option

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy tidy.c

2007-05-04 Thread Nuno Lopes
nlopess Fri May  4 17:11:05 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/tidy   tidy.c 
  Log:
  get ride of warnings (different signdess)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.22&r2=1.66.2.8.2.23&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.22 
php-src/ext/tidy/tidy.c:1.66.2.8.2.23
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.22   Sun Feb 11 16:07:30 2007
+++ php-src/ext/tidy/tidy.c Fri May  4 17:11:05 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.22 2007/02/11 16:07:30 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.23 2007/05/04 17:11:05 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -517,7 +517,7 @@
tidyBufInit(&output);
 
tidySaveBuffer (doc, &output);
-   RETVAL_STRINGL(output.bp, output.size ? 
output.size-1 : 0, 1);
+   RETVAL_STRINGL((char*)output.bp, output.size ? 
output.size-1 : 0, 1);
tidyBufFree(&output);
} else {
RETVAL_FALSE;
@@ -685,7 +685,7 @@
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
-   ZVAL_STRINGL(out, output.bp, output.size ? 
output.size-1 : 0, TRUE);
+   ZVAL_STRINGL(out, (char*)output.bp, output.size ? 
output.size-1 : 0, TRUE);
tidyBufFree(&output);
break;
 
@@ -720,7 +720,7 @@
if (obj->ptdoc) {
tidyNodeGetText(obj->ptdoc->doc, obj->node, 
&buf);
}
-   ZVAL_STRINGL(out, buf.bp, buf.size ? buf.size-1 : 0, 
TRUE);
+   ZVAL_STRINGL(out, (char*)buf.bp, buf.size ? buf.size-1 
: 0, TRUE);
tidyBufFree(&buf);
break;
 
@@ -742,7 +742,7 @@

if (output.size) {
MAKE_STD_ZVAL(temp);
-   ZVAL_STRINGL(temp, output.bp, output.size-1, TRUE);
+   ZVAL_STRINGL(temp, (char*)output.bp, output.size-1, TRUE);
zend_hash_update(obj->std.properties, "value", sizeof("value"), 
(void *)&temp, sizeof(zval *), NULL);
}

@@ -750,7 +750,7 @@
 
if (obj->ptdoc->errbuf->size) {
MAKE_STD_ZVAL(temp);
-   ZVAL_STRINGL(temp, obj->ptdoc->errbuf->bp, 
obj->ptdoc->errbuf->size-1, TRUE);
+   ZVAL_STRINGL(temp, (char*)obj->ptdoc->errbuf->bp, 
obj->ptdoc->errbuf->size-1, TRUE);
zend_hash_update(obj->std.properties, "errorBuffer", 
sizeof("errorBuffer"), (void *)&temp, sizeof(zval *), NULL);
}
 }
@@ -992,7 +992,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.22 2007/02/11 16:07:30 
nlopess Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.23 2007/05/04 17:11:05 
nlopess Exp $)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1039,7 +1039,7 @@
tidyBufInit(&output);
 
tidySaveBuffer(doc, &output);
-   RETVAL_STRINGL(output.bp, output.size ? output.size-1 : 
0, 1);
+   RETVAL_STRINGL((char*)output.bp, output.size ? 
output.size-1 : 0, 1);
 
tidyBufFree(&output);
}
@@ -1088,7 +1088,7 @@
TIDY_FETCH_OBJECT;
 
if (obj->ptdoc->errbuf && obj->ptdoc->errbuf->bp) {
-   RETURN_STRINGL(obj->ptdoc->errbuf->bp, 
obj->ptdoc->errbuf->size-1, 1);
+   RETURN_STRINGL((char*)obj->ptdoc->errbuf->bp, 
obj->ptdoc->errbuf->size-1, 1);
} else {
RETURN_FALSE;
}
@@ -1105,7 +1105,7 @@
tidyBufInit(&output);
tidySaveBuffer(obj->ptdoc->doc, &output);
 
-   RETVAL_STRINGL(output.bp, output.size ? output.size-1 : 0, 1);
+   RETVAL_STRINGL((char*)output.bp, output.size ? output.size-1 : 0, 1);
 
tidyBufFree(&output);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard http_fopen_wrapper.c

2007-04-23 Thread Nuno Lopes

test please?


- Original Message - 
From: "Hannes Magnusson" <[EMAIL PROTECTED]>

To: 
Sent: Monday, April 23, 2007 5:37 PM
Subject: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard http_fopen_wrapper.c



bjori Mon Apr 23 16:37:28 2007 UTC

 Modified files:  (Branch: PHP_5_2)
   /php-src/ext/standard http_fopen_wrapper.c
 Log:
 MFH: Plug leak when trying to write via the http wrapper


http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99.2.12.2.8&r2=1.99.2.12.2.9&diff_format=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.8 
php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9
--- php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.8 Tue Feb 27 
03:28:16 2007

+++ php-src/ext/standard/http_fopen_wrapper.c Mon Apr 23 16:37:28 2007
@@ -19,7 +19,7 @@
   |  Sara Golemon <[EMAIL PROTECTED]> 
|


+--+
 */
-/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.8 2007/02/27 03:28:16 iliaa 
Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9 2007/04/23 16:37:28 bjori 
Exp $ */


#include "php.h"
#include "php_globals.h"
@@ -138,6 +138,7 @@

 if (strpbrk(mode, "awx+")) {
 php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper 
does not support writeable connections.");

+ php_url_free(resource);
 return NULL;
 }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_sqlite/sqlite/src parse.c

2007-04-20 Thread Nuno Lopes
nlopess Fri Apr 20 14:51:16 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_sqlite/sqlite/src  parse.c 
  Log:
  fix gcov build
  http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite/src/parse.c?r1=1.6.2.5.2.7&r2=1.6.2.5.2.8&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite/src/parse.c
diff -u php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.7 
php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.8
--- php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.7   Mon Apr  9 
16:35:11 2007
+++ php-src/ext/pdo_sqlite/sqlite/src/parse.c   Fri Apr 20 14:51:16 2007
@@ -4,7 +4,7 @@
 /* First off, code is include which follows the "include" declaration
 ** in the input file. */
 #include 
-#line 56 "parse.y"
+#line 56 "ext/pdo_sqlite/sqlite/src/parse.y"
 
 #include "sqliteInt.h"
 #include "parse.h"
@@ -43,7 +43,7 @@
 */
 struct AttachKey { int type;  Token key; };
 
-#line 48 "parse.c"
+#line 48 "ext/pdo_sqlite/sqlite/src/parse.c"
 /* Next is all token values, in a form suitable for use by makeheaders.
 ** This section will be null unless lemon is run with the -m switch.
 */
@@ -1267,9 +1267,9 @@
 case 155:
 case 189:
 case 206:
-#line 374 "parse.y"
+#line 374 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SelectDelete((yypminor->yy219));}
-#line 1274 "parse.c"
+#line 1274 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 169:
 case 170:
@@ -1282,9 +1282,9 @@
 case 222:
 case 223:
 case 235:
-#line 623 "parse.y"
+#line 623 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy172));}
-#line 1289 "parse.c"
+#line 1289 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 174:
 case 182:
@@ -1297,40 +1297,40 @@
 case 212:
 case 215:
 case 221:
-#line 863 "parse.y"
+#line 863 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprListDelete((yypminor->yy174));}
-#line 1304 "parse.c"
+#line 1304 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 188:
 case 193:
 case 201:
 case 202:
-#line 487 "parse.y"
+#line 487 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SrcListDelete((yypminor->yy373));}
-#line 1312 "parse.c"
+#line 1312 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 205:
 case 208:
 case 214:
-#line 504 "parse.y"
+#line 504 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy432));}
-#line 1319 "parse.c"
+#line 1319 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 231:
 case 236:
-#line 964 "parse.y"
+#line 964 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3DeleteTriggerStep((yypminor->yy243));}
-#line 1325 "parse.c"
+#line 1325 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 233:
-#line 950 "parse.y"
+#line 950 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy370).b);}
-#line 1330 "parse.c"
+#line 1330 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 238:
-#line 1037 "parse.y"
+#line 1037 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy386));}
-#line 1335 "parse.c"
+#line 1335 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 default:  break;   /* If no destructor action specified: do nothing */
   }
@@ -1489,11 +1489,11 @@
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will execute if the parser
** stack every overflows */
-#line 44 "parse.y"
+#line 44 "ext/pdo_sqlite/sqlite/src/parse.y"
 
   sqlite3ErrorMsg(pParse, "parser stack overflow");
   pParse->parseError = 1;
-#line 1499 "parse.c"
+#line 1499 "ext/pdo_sqlite/sqlite/src/parse.c"
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument 
var */
 }
 
@@ -1944,67 +1944,67 @@
   case 303:
   case 305:
   case 309:
-#line 97 "parse.y"
+#line 97 "ext/pdo_sqlite/sqlite/src/parse.y"
 {
 }
-#line 1953 "parse.c"
+#line 1953 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 3:
-#line 100 "parse.y"
+#line 100 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3FinishCoding(pParse); }
-#line 1958 "parse.c"
+#line 1958 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 6:
-#line 103 "parse.y"
+#line 103 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 0); }
-#line 1963 "parse.c"
+#line 1963 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 7:
-#line 105 "parse.y"
+#line 105 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 1); }
-#line 1968 "parse.c"
+#line 1968 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 8:
-#line 106 "parse.y"
+#line 106 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 2); }
-#line 1973 "parse.c"
+#line 1973 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 9:
-#line 112 "parse.y"
+#line 112 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy46);}
-#line 1978 "parse.c"
+#line 1978 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 13:
-#line 

[PHP-CVS] cvs: php-src(PHP_5_2) / INSTALL /win32 install.txt

2007-04-20 Thread Nuno Lopes
nlopess Fri Apr 20 14:13:47 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcINSTALL 
/php-src/win32  install.txt 
  Log:
  update install instructions (auto-generated from phpdoc XML sources)
  http://cvs.php.net/viewvc.cgi/php-src/INSTALL?r1=1.37.2.2.2.2&r2=1.37.2.2.2.3&diff_format=u
Index: php-src/INSTALL
diff -u php-src/INSTALL:1.37.2.2.2.2 php-src/INSTALL:1.37.2.2.2.3
--- php-src/INSTALL:1.37.2.2.2.2Fri Jan 19 19:25:02 2007
+++ php-src/INSTALL Fri Apr 20 14:13:47 2007
@@ -11,7 +11,7 @@
 Caudium
 fhttpd related notes
 Sun, iPlanet and Netscape servers on Sun Solaris
-CGI and commandline setups
+CGI and command line setups
 HP-UX specific installation notes
 OpenBSD installation notes
 Solaris specific installation tips
@@ -20,6 +20,7 @@
3. Installation on Mac OS X
 
 Using Packages
+Using the bundled PHP
 Compiling for OS X Server
 Compiling for MacOS X Client
 
@@ -28,7 +29,7 @@
 Introduction to PECL Installations
 Downloading PECL extensions
 PECL for Windows users
-Compiling shared PECL extensions with PEAR
+Compiling shared PECL extensions with the pecl command
 Compiling shared PECL extensions with phpize
 Compiling PECL extensions statically into PHP
 
@@ -90,7 +91,7 @@
 
With PHP you can also write desktop GUI applications using the PHP-GTK
extension. This is a completely different approach than writing web
-   pages, as you do not output any HTML, but manage windows and objects
+   pages, as you do not output any HTML, but manage Windows and objects
within them. For more information about PHP-GTK, please visit the site
dedicated to this extension. PHP-GTK is not included in the official
PHP distribution.
@@ -124,10 +125,10 @@
package installation system. This can assist in setting up a standard
configuration, but if you need to have a different set of features
(such as a secure server, or a different database driver), you may need
-   to build PHP and/or your webserver. If you are unfamiliar with building
-   and compiling your own software, it is worth checking to see whether
-   somebody has already built a packaged version of PHP with the features
-   you need.
+   to build PHP and/or your web server. If you are unfamiliar with
+   building and compiling your own software, it is worth checking to see
+   whether somebody has already built a packaged version of PHP with the
+   features you need.
 
Prerequisite knowledge and software for compiling:
 
@@ -139,8 +140,8 @@
  * Any module specific components (such as gd, pdf libs, etc.)
 
The initial PHP setup and configuration process is controlled by the
-   use of the commandline options of the configure script. You could get a
-   list of all available options along with short explanations running
+   use of the command line options of the configure script. You could get
+   a list of all available options along with short explanations running
./configure --help. Our manual documents the different options
separately. You will find the core options in the appendix, while the
different extension specific options are descibed on the reference
@@ -345,7 +346,7 @@
will mean that you can compile apache separately, and don't have to
recompile everything as you add to, or change, PHP. Building PHP into
apache (static method) means that PHP will load and run faster. For
-   more information, see the Apache webpage on DSO support.
+   more information, see the Apache web page on DSO support.
 
  Note: Apache's default httpd.conf currently ships with a section
  that looks like this:
@@ -562,13 +563,13 @@
From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to
generate custom directory listings and error pages. Additional
functions for Apache compatibility are also available. For support in
-   current webservers read the note about subrequests.
+   current web servers read the note about subrequests.
 
You can find more information about setting up PHP for the Netscape
Enterprise Server (NES) here:
http://benoit.noss.free.fr/php/install-php4.html
 
-   To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape webservers,
+   To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers,
enter the proper install directory for the --with-nsapi=[DIR] option.
The default directory is usually /opt/netscape/suitespot/. Please also
read /php-xxx-version/sapi/nsapi/nsapi-readme.txt.
@@ -610,7 +611,7 @@
Configuration Instructions for Sun/iPlanet/Netscape. Firstly you may
need to add some paths to the LD_LIBRARY_PATH environment for the
server to find all the shared libs. This can best done in the start
-   script for your webserver. The start script is often located in:
+   script for your web server. The start script is

[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c

2007-04-04 Thread Nuno Lopes
nlopess Wed Apr  4 14:26:04 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gdft.c 
  Log:
  MFB: fix race condition on font cache shutdown
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.43&r2=1.44&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.43 php-src/ext/gd/libgd/gdft.c:1.44
--- php-src/ext/gd/libgd/gdft.c:1.43Wed Apr  4 00:44:38 2007
+++ php-src/ext/gd/libgd/gdft.c Wed Apr  4 14:26:04 2007
@@ -715,13 +715,15 @@
 
 void gdFontCacheShutdown()
 {
+   gdMutexLock(gdFontCacheMutex);
+
if (fontCache) {
-   gdMutexLock(gdFontCacheMutex);
gdCacheDelete(fontCache);
fontCache = NULL;
-   gdMutexUnlock(gdFontCacheMutex);
FT_Done_FreeType(library);
}
+
+   gdMutexUnlock(gdFontCacheMutex);
 }
 
 void gdFreeFontCache()

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gdft.c

2007-04-04 Thread Nuno Lopes
nlopess Wed Apr  4 14:24:03 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gdft.c 
  Log:
  fix race condition on font cache shutdown
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.36.4.7&r2=1.36.4.8&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.36.4.7 
php-src/ext/gd/libgd/gdft.c:1.36.4.8
--- php-src/ext/gd/libgd/gdft.c:1.36.4.7Wed Apr  4 00:47:55 2007
+++ php-src/ext/gd/libgd/gdft.c Wed Apr  4 14:24:03 2007
@@ -715,13 +715,15 @@
 
 void gdFontCacheShutdown()
 {
+   gdMutexLock(gdFontCacheMutex);
+
if (fontCache) {
-   gdMutexLock(gdFontCacheMutex);
gdCacheDelete(fontCache);
fontCache = NULL;
-   gdMutexUnlock(gdFontCacheMutex);
FT_Done_FreeType(library);
}
+
+   gdMutexUnlock(gdFontCacheMutex);
 }
 
 void gdFreeFontCache()

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard var_unserializer.c

2007-03-23 Thread Nuno Lopes
nlopess Fri Mar 23 20:28:40 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   var_unserializer.c 
  Log:
  regenerate to fix gcov build. plus use re2c bitvectors
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4.2.3&r2=1.70.2.4.2.4&diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4.2.3 
php-src/ext/standard/var_unserializer.c:1.70.2.4.2.4
--- php-src/ext/standard/var_unserializer.c:1.70.2.4.2.3Fri Mar 23 
20:15:21 2007
+++ php-src/ext/standard/var_unserializer.c Fri Mar 23 20:28:40 2007
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.2 on Fri Mar 23 13:13:16 2007 */
+/* Generated by re2c 0.11.0 on Fri Mar 23 20:26:08 2007 */
 #line 1 "ext/standard/var_unserializer.re"
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.70.2.4.2.3 2007/03/23 20:15:21 stas Exp $ */
+/* $Id: var_unserializer.c,v 1.70.2.4.2.4 2007/03/23 20:28:40 nlopess Exp $ */
 
 #include "php.h"
 #include "ext/standard/php_var.h"
@@ -393,173 +393,151 @@
 


-
-#line 398 ""
 {
-   YYCTYPE yych;
+   static unsigned char yybm[] = {
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+ 0,   0,   0,   0,   0,   0,   0,   0, 
+   };
 
-   if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case 'C':
-   case 'O':   goto yy13;
-   case 'N':   goto yy5;
-   case 'R':   goto yy2;
-   case 'S':   goto yy10;
-   case 'a':   goto yy11;
-   case 'b':   goto yy6;
-   case 'd':   goto yy8;
-   case 'i':   goto yy7;
-   case 'o':   goto yy12;
-   case 'r':   goto yy4;
-   case 's':   goto yy9;
-   case '}':   goto yy14;
-   default:goto yy16;
-   }
+#line 433 "ext/standard/var_unserializer.c"
+   {
+   YYCTYPE yych;
+
+   if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
+   yych = *YYCURSOR;
+   switch(yych) {
+   case 'C':
+   case 'O':   goto yy13;
+   case 'N':   goto yy5;
+   case 'R':   goto yy2;
+   case 'S':   goto yy10;
+   case 'a':   goto yy11;
+   case 'b':   goto yy6;
+   case 'd':   goto yy8;
+   case 'i':   goto yy7;
+   case 'o':   goto yy12;
+   case 'r':   goto yy4;
+   case 's':   goto yy9;
+   case '}':   goto yy14;
+   default:goto yy16;
+   }
 yy2:
-   yych = *(YYMARKER = ++YYCURSOR);
-   switch(yych) {
-   case ':':   goto yy95;
-   default:goto yy3;
-   }
+   yych = *(YYMARKER = ++YYCURSOR);
+   if(yych == ':') goto yy95;
 yy3:
 #line 694 "ext/standard/var_unserializer.re"
-   { return 0; }
-#line 429 ""
+   { return 0; }
+#line 461 "ext/standard/var_unserializer.c"
 yy4:
-   yych = *(YYMARKE

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS

2007-03-08 Thread Nuno Lopes
nlopess Thu Mar  8 22:04:33 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  BFN: gd gif reading
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.578&r2=1.2027.2.547.2.579&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.578 php-src/NEWS:1.2027.2.547.2.579
--- php-src/NEWS:1.2027.2.547.2.578 Thu Mar  8 00:44:23 2007
+++ php-src/NEWSThu Mar  8 22:04:33 2007
@@ -15,6 +15,7 @@
 - Added --ri switch to CLI which allows to check extension information. 
(Marcus)
 - Added tidyNode::getParent() method (John, Nuno)
 - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry)
+- Fixed a thread safety issue in gd gif read code (Nuno, Roman Nemecek)
 - Fixed bug #40752 (parse_ini_file() segfaults when a scalar setting is 
   redeclared as an array). (Tony)
 - Fixed bug #40727 (segfault in PDO when failed to bind parameters). (Tony)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gd_gif_in.c

2007-03-08 Thread Nuno Lopes
nlopess Thu Mar  8 20:26:48 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  MFB: fix thread unsafety in the gif reader code (merge from libgd cvs)
  http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.13&r2=1.14&diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.13 
php-src/ext/gd/libgd/gd_gif_in.c:1.14
--- php-src/ext/gd/libgd/gd_gif_in.c:1.13   Fri Mar  2 18:46:16 2007
+++ php-src/ext/gd/libgd/gd_gif_in.cThu Mar  8 20:26:48 2007
@@ -68,11 +68,29 @@
int disposal;
 } Gif89 = { -1, -1, -1, 0 };
 
+#define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2)
+
+typedef struct {
+   unsigned charbuf[280];
+   int  curbit, lastbit, done, last_byte;
+} CODE_STATIC_DATA;
+
+typedef struct {
+   int fresh;
+   int code_size, set_code_size;
+   int max_code, max_code_size;
+   int firstcode, oldcode;
+   int clear_code, end_code;
+   int table[2][(1<< MAX_LWZ_BITS)];
+   int stack[STACK_SIZE], *sp;
+   CODE_STATIC_DATA scd;
+} LZW_STATIC_DATA;
+
 static int ReadColorMap (gdIOCtx *fd, int number, unsigned char 
(*buffer)[256]);
 static int DoExtension (gdIOCtx *fd, int label, int *Transparent);
 static int GetDataBlock (gdIOCtx *fd, unsigned char *buf);
-static int GetCode (gdIOCtx *fd, int code_size, int flag);
-static int LWZReadByte (gdIOCtx *fd, int flag, int input_code_size);
+static int GetCode (gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int 
flag);
+static int LWZReadByte (gdIOCtx *fd, LZW_STATIC_DATA *sd, int flag, int 
input_code_size);
 
 static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, 
unsigned char (*cmap)[256], int interlace); /*1.4//, int ignore); */
 
@@ -257,10 +275,11 @@
 
 static int DoExtension(gdIOCtx *fd, int label, int *Transparent) /* {{{ */
 {
-   static unsigned char buf[256];
+   unsigned char buf[256];
 
switch (label) {
case 0xf9:  /* Graphic Control Extension */
+   memset(buf, 0, 4); /* initialize a few bytes in the 
case the next function fails */
(void) GetDataBlock(fd, (unsigned char*) buf);
Gif89.disposal= (buf[0] >> 2) & 0x7;
Gif89.inputFlag   = (buf[0] >> 1) & 0x1;
@@ -322,119 +341,109 @@
 }
 /* }}} */
 
-static int GetCode_(gdIOCtx *fd, int code_size, int flag) /* {{{ */
+static int GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int 
flag) /* {{{ */
 {
-   static unsigned charbuf[280];
-   static int  curbit, lastbit, done, last_byte;
-   int i, j, ret;
-   unsigned char   count;
+   int   i, j, ret;
+   unsigned char count;
 
if (flag) {
-   curbit = 0;
-   lastbit = 0;
-   done = FALSE;
+   scd->curbit = 0;
+   scd->lastbit = 0;
+   scd->last_byte = 0;
+   scd->done = FALSE;
return 0;
}
 
-   if ( (curbit+code_size) >= lastbit) {
-   if (done) {
-   if (curbit >= lastbit) {
+   if ( (scd->curbit + code_size) >= scd->lastbit) {
+   if (scd->done) {
+   if (scd->curbit >= scd->lastbit) {
/* Oh well */
}
return -1;
}
-   buf[0] = buf[last_byte-2];
-   buf[1] = buf[last_byte-1];
+   scd->buf[0] = scd->buf[scd->last_byte-2];
+   scd->buf[1] = scd->buf[scd->last_byte-1];
 
-   if ((count = GetDataBlock(fd, &buf[2])) <= 0)
-   done = TRUE;
+   if ((count = GetDataBlock(fd, &scd->buf[2])) <= 0)
+   scd->done = TRUE;
 
-   last_byte = 2 + count;
-   curbit = (curbit - lastbit) + 16;
-   lastbit = (2+count)*8 ;
+   scd->last_byte = 2 + count;
+   scd->curbit = (scd->curbit - scd->lastbit) + 16;
+   scd->lastbit = (2+count)*8 ;
}
 
ret = 0;
-   for (i = curbit, j = 0; j < code_size; ++i, ++j)
-   ret |= ((buf[ i / 8 ] & (1 << (i % 8))) != 0) << j;
+   for (i = scd->curbit, j = 0; j < code_size; ++i, ++j)
+   ret |= ((scd->buf[ i / 8 ] & (1 << (i % 8))) != 0) << j;
 
-   curbit += code_size;
+   scd->curbit += code_size;
return ret;
 }
 
-static int GetCode(gdIOCtx *fd, int code_size, int flag) /* {{{ */
+static int GetCode(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int 
flag) /* {{{ */
 {
int rv;
 
-   rv = GetCode_(fd,code_size,flag);
+   rv = GetCode_(fd, scd, code_size, flag);
if (VERBOSE) php_gd_error_ex(E_NOTICE, "[GetCode(,%d,%d) returning 
%d]",code_size,flag,rv);
return(rv);
 }
 /* }}} 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c

2007-03-08 Thread Nuno Lopes
nlopess Thu Mar  8 20:24:54 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  fix thread unsafety in the gif reader code (merge from libgd cvs)
  http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.8&r2=1.5.4.2.2.9&diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.8 
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.9
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.8Fri Mar  2 18:41:25 2007
+++ php-src/ext/gd/libgd/gd_gif_in.cThu Mar  8 20:24:53 2007
@@ -68,11 +68,29 @@
int disposal;
 } Gif89 = { -1, -1, -1, 0 };
 
+#define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2)
+
+typedef struct {
+   unsigned charbuf[280];
+   int  curbit, lastbit, done, last_byte;
+} CODE_STATIC_DATA;
+
+typedef struct {
+   int fresh;
+   int code_size, set_code_size;
+   int max_code, max_code_size;
+   int firstcode, oldcode;
+   int clear_code, end_code;
+   int table[2][(1<< MAX_LWZ_BITS)];
+   int stack[STACK_SIZE], *sp;
+   CODE_STATIC_DATA scd;
+} LZW_STATIC_DATA;
+
 static int ReadColorMap (gdIOCtx *fd, int number, unsigned char 
(*buffer)[256]);
 static int DoExtension (gdIOCtx *fd, int label, int *Transparent);
 static int GetDataBlock (gdIOCtx *fd, unsigned char *buf);
-static int GetCode (gdIOCtx *fd, int code_size, int flag);
-static int LWZReadByte (gdIOCtx *fd, int flag, int input_code_size);
+static int GetCode (gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int 
flag);
+static int LWZReadByte (gdIOCtx *fd, LZW_STATIC_DATA *sd, int flag, int 
input_code_size);
 
 static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, 
unsigned char (*cmap)[256], int interlace); /*1.4//, int ignore); */
 
@@ -257,10 +275,11 @@
 
 static int DoExtension(gdIOCtx *fd, int label, int *Transparent) /* {{{ */
 {
-   static unsigned char buf[256];
+   unsigned char buf[256];
 
switch (label) {
case 0xf9:  /* Graphic Control Extension */
+   memset(buf, 0, 4); /* initialize a few bytes in the 
case the next function fails */
(void) GetDataBlock(fd, (unsigned char*) buf);
Gif89.disposal= (buf[0] >> 2) & 0x7;
Gif89.inputFlag   = (buf[0] >> 1) & 0x1;
@@ -322,119 +341,109 @@
 }
 /* }}} */
 
-static int GetCode_(gdIOCtx *fd, int code_size, int flag) /* {{{ */
+static int GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int 
flag) /* {{{ */
 {
-   static unsigned charbuf[280];
-   static int  curbit, lastbit, done, last_byte;
-   int i, j, ret;
-   unsigned char   count;
+   int   i, j, ret;
+   unsigned char count;
 
if (flag) {
-   curbit = 0;
-   lastbit = 0;
-   done = FALSE;
+   scd->curbit = 0;
+   scd->lastbit = 0;
+   scd->last_byte = 0;
+   scd->done = FALSE;
return 0;
}
 
-   if ( (curbit+code_size) >= lastbit) {
-   if (done) {
-   if (curbit >= lastbit) {
+   if ( (scd->curbit + code_size) >= scd->lastbit) {
+   if (scd->done) {
+   if (scd->curbit >= scd->lastbit) {
/* Oh well */
}
return -1;
}
-   buf[0] = buf[last_byte-2];
-   buf[1] = buf[last_byte-1];
+   scd->buf[0] = scd->buf[scd->last_byte-2];
+   scd->buf[1] = scd->buf[scd->last_byte-1];
 
-   if ((count = GetDataBlock(fd, &buf[2])) <= 0)
-   done = TRUE;
+   if ((count = GetDataBlock(fd, &scd->buf[2])) <= 0)
+   scd->done = TRUE;
 
-   last_byte = 2 + count;
-   curbit = (curbit - lastbit) + 16;
-   lastbit = (2+count)*8 ;
+   scd->last_byte = 2 + count;
+   scd->curbit = (scd->curbit - scd->lastbit) + 16;
+   scd->lastbit = (2+count)*8 ;
}
 
ret = 0;
-   for (i = curbit, j = 0; j < code_size; ++i, ++j)
-   ret |= ((buf[ i / 8 ] & (1 << (i % 8))) != 0) << j;
+   for (i = scd->curbit, j = 0; j < code_size; ++i, ++j)
+   ret |= ((scd->buf[ i / 8 ] & (1 << (i % 8))) != 0) << j;
 
-   curbit += code_size;
+   scd->curbit += code_size;
return ret;
 }
 
-static int GetCode(gdIOCtx *fd, int code_size, int flag) /* {{{ */
+static int GetCode(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int 
flag) /* {{{ */
 {
int rv;
 
-   rv = GetCode_(fd,code_size,flag);
+   rv = GetCode_(fd, scd, code_size, flag);
if (VERBOSE) php_gd_error_ex(E_NOTICE, "[GetCode(,%d,%d) returning 
%d]",cod

[PHP-CVS] cvs: php-src /ext/standard/tests/file proc_open01.phpt

2007-03-02 Thread Nuno Lopes
nlopess Fri Mar  2 18:54:41 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/fileproc_open01.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/proc_open01.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/standard/tests/file/proc_open01.phpt
diff -u php-src/ext/standard/tests/file/proc_open01.phpt:1.4 
php-src/ext/standard/tests/file/proc_open01.phpt:1.5
--- php-src/ext/standard/tests/file/proc_open01.phpt:1.4Mon Nov 28 
14:33:44 2005
+++ php-src/ext/standard/tests/file/proc_open01.phptFri Mar  2 18:54:41 2007
@@ -32,7 +32,7 @@
$read_fds = array($pipes[1]);
$write_fds = NULL;
$exp_fds = NULL;
-   $retval = stream_select($read_fds, $write_fds, $exp_fds, 1);
+   $retval = stream_select($read_fds, $write_fds, $exp_fds, 5);
if ($retval === false) {
print "select() failed\n";
break;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file proc_open01.phpt

2007-03-02 Thread Nuno Lopes
nlopess Fri Mar  2 18:54:13 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/fileproc_open01.phpt 
  Log:
  increase the stream_select() timeout, to make the test pass in a slow machine 
with valgrind
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/proc_open01.phpt?r1=1.3.4.1&r2=1.3.4.1.2.1&diff_format=u
Index: php-src/ext/standard/tests/file/proc_open01.phpt
diff -u php-src/ext/standard/tests/file/proc_open01.phpt:1.3.4.1 
php-src/ext/standard/tests/file/proc_open01.phpt:1.3.4.1.2.1
--- php-src/ext/standard/tests/file/proc_open01.phpt:1.3.4.1Mon Nov 28 
14:33:03 2005
+++ php-src/ext/standard/tests/file/proc_open01.phptFri Mar  2 18:54:13 2007
@@ -32,7 +32,7 @@
$read_fds = array($pipes[1]);
$write_fds = NULL;
$exp_fds = NULL;
-   $retval = stream_select($read_fds, $write_fds, $exp_fds, 1);
+   $retval = stream_select($read_fds, $write_fds, $exp_fds, 5);
if ($retval === false) {
print "select() failed\n";
break;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gd_gif_in.c

2007-03-02 Thread Nuno Lopes
nlopess Fri Mar  2 18:46:16 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  MFB
  #Pierre: libgd isn't affected. this problem was caused by the recent 
conversion to strlcpy()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.12 
php-src/ext/gd/libgd/gd_gif_in.c:1.13
--- php-src/ext/gd/libgd/gd_gif_in.c:1.12   Sat Nov  4 14:32:23 2006
+++ php-src/ext/gd/libgd/gd_gif_in.cFri Mar  2 18:46:16 2007
@@ -121,7 +121,6 @@
int bitPixel;
inti;
/*1.4//int imageCount = 0; */
-   charversion[4];
 
gdImagePtr im = 0;
ZeroDataBlock = FALSE;
@@ -133,10 +132,8 @@
if (strncmp((char *)buf,"GIF",3) != 0) {
return 0;
}
-   strncpy(version, (char *)buf + 3, 3);
-   version[3] = '\0';
 
-   if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
+   if ((strncmp((char *)buf+3, "87a", 3) != 0) && (strncmp((char *)buf+3, 
"89a", 3) != 0)) {
return 0;
}
if (! ReadOK(fd,buf,7)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd_gif_in.c

2007-03-02 Thread Nuno Lopes
nlopess Fri Mar  2 18:41:25 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd_gif_in.c 
  Log:
  fix access to non initialized memory (check valgrind reports on 
http://gcov.php.net)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.5.4.2.2.7&r2=1.5.4.2.2.8&diff_format=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.7 
php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.8
--- php-src/ext/gd/libgd/gd_gif_in.c:1.5.4.2.2.7Sat Feb 24 17:59:45 2007
+++ php-src/ext/gd/libgd/gd_gif_in.cFri Mar  2 18:41:25 2007
@@ -121,7 +121,6 @@
int bitPixel;
inti;
/*1.4//int imageCount = 0; */
-   charversion[4];
 
gdImagePtr im = 0;
ZeroDataBlock = FALSE;
@@ -133,9 +132,8 @@
if (strncmp((char *)buf,"GIF",3) != 0) {
return 0;
}
-   strlcpy(version, (char *)buf + 3, sizeof(version));
 
-   if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
+   if ((strncmp((char*)buf+3, "87a", 3) != 0) && (strncmp((char*)buf+3, 
"89a", 3) != 0)) {
return 0;
}
if (! ReadOK(fd,buf,7)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_4) /ext/gd/libgd gdft.c

2007-03-01 Thread Nuno Lopes
nlopess Thu Mar  1 19:09:33 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/gd/libgd   gdft.c 
  Log:
  MFH
  #Pierre: I think this code still needs more patching..
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.11.2.19.2.2&r2=1.11.2.19.2.3&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.11.2.19.2.2 
php-src/ext/gd/libgd/gdft.c:1.11.2.19.2.3
--- php-src/ext/gd/libgd/gdft.c:1.11.2.19.2.2   Wed Feb 28 18:20:56 2007
+++ php-src/ext/gd/libgd/gdft.c Thu Mar  1 19:09:33 2007
@@ -772,10 +772,12 @@
 void gdFontCacheShutdown()
 {
if (fontCache) {
-   gdMutexShutdown(gdFontCacheMutex);
-   gdCacheDelete(fontCache);
+   gdMutexLock(gdFontCacheMutex);
+   gdCacheDelete(fontCache);
fontCache = NULL;
-   FT_Done_FreeType(library);
+   gdMutexUnlock(gdFontCacheMutex);
+   gdMutexShutdown(gdFontCacheMutex);
+   FT_Done_FreeType(library);
}
 }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gdft.c

2007-03-01 Thread Nuno Lopes
nlopess Thu Mar  1 18:41:45 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gdft.c 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.41&r2=1.42&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.41 php-src/ext/gd/libgd/gdft.c:1.42
--- php-src/ext/gd/libgd/gdft.c:1.41Sun Feb 25 02:56:03 2007
+++ php-src/ext/gd/libgd/gdft.c Thu Mar  1 18:41:45 2007
@@ -721,6 +721,7 @@
gdMutexLock(gdFontCacheMutex);
gdCacheDelete(fontCache);
fontCache = NULL;
+   gdMutexUnlock(gdFontCacheMutex);
gdMutexShutdown(gdFontCacheMutex);
FT_Done_FreeType(library);
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gdft.c

2007-03-01 Thread Nuno Lopes
nlopess Thu Mar  1 18:39:50 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gdft.c 
  Log:
  merge from gd sources: unlock mutex before shuting it down
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.36.4.5&r2=1.36.4.6&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.36.4.5 
php-src/ext/gd/libgd/gdft.c:1.36.4.6
--- php-src/ext/gd/libgd/gdft.c:1.36.4.5Sun Feb 25 02:45:06 2007
+++ php-src/ext/gd/libgd/gdft.c Thu Mar  1 18:39:49 2007
@@ -721,6 +721,7 @@
gdMutexLock(gdFontCacheMutex);
gdCacheDelete(fontCache);
fontCache = NULL;
+   gdMutexUnlock(gdFontCacheMutex);
gdMutexShutdown(gdFontCacheMutex);
FT_Done_FreeType(library);
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_4) /main php_compat.h

2007-02-25 Thread Nuno Lopes
nlopess Sun Feb 25 18:50:16 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/main   php_compat.h 
  Log:
  MFH: update PCRE symbols list
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.11.4.6.2.3&r2=1.11.4.6.2.4&diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.11.4.6.2.3 
php-src/main/php_compat.h:1.11.4.6.2.4
--- php-src/main/php_compat.h:1.11.4.6.2.3  Wed Aug 23 20:40:39 2006
+++ php-src/main/php_compat.h   Sun Feb 25 18:50:16 2007
@@ -12,7 +12,7 @@
 #define pcre_compile2  php_pcre_compile2
 #define pcre_copy_substringphp_pcre_copy_substring
 #define pcre_exec  php_pcre_exec
-#define pcre_get_substring php_pcre_substring
+#define pcre_get_substring php_pcre_get_substring
 #define pcre_get_substring_listphp_pcre_get_substring_list
 #define pcre_info  php_pcre_info
 #define pcre_maketablesphp_pcre_maketables
@@ -23,7 +23,6 @@
 #define pcre_mallocphp_pcre_malloc
 #define pcre_configphp_pcre_config
 #define pcre_copy_named_substring php_pcre_copy_named_substring
-#define pcre_dfa_exec  php_pcre_dfa_exec
 #define pcre_free_substringphp_pcre_free_substring
 #define pcre_free_substring_list php_pcre_free_substring_list
 #define pcre_get_named_substring php_pcre_get_named_substring
@@ -35,6 +34,22 @@
 #define _pcre_ucp_othercasephp__pcre_ucp_othercase
 #define _pcre_valid_utf8   php__pcre_valid_utf8
 #define _pcre_xclass   php__pcre_xclass
+#define pcre_callout   php_pcre_callout
+#define _pcre_OP_lengths   php__pcre_OP_lengths
+/* this one doesn't work because pcre.h isn't included from the 
pcre_chartables.c file
+#define _pcre_default_tables   php__pcre_default_tables */
+#define pcre_get_stringtable_entries   php_pcre_get_stringtable_entries
+#define _pcre_is_newline   php__pcre_is_newline
+#define pcre_stack_freephp_pcre_stack_free
+#define pcre_stack_malloc  php_pcre_stack_malloc
+#define _pcre_utf8_table1  php__pcre_utf8_table1
+#define _pcre_utf8_table1_size php__pcre_utf8_table1_size
+#define _pcre_utf8_table2  php__pcre_utf8_table2
+#define _pcre_utf8_table3  php__pcre_utf8_table3
+#define _pcre_utf8_table4  php__pcre_utf8_table4
+#define _pcre_utt  php__pcre_utt
+#define _pcre_utt_size php__pcre_utt_size
+#define _pcre_was_newline  php__pcre_was_newline
 #endif
 
 #define lookup php_lookup

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /main php_compat.h

2007-02-25 Thread Nuno Lopes
nlopess Sun Feb 25 18:48:19 2007 UTC

  Modified files:  
/php-src/main   php_compat.h 
  Log:
  MFB: update pcre symbol list
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.31&r2=1.32&diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.31 php-src/main/php_compat.h:1.32
--- php-src/main/php_compat.h:1.31  Mon Jan  1 09:29:35 2007
+++ php-src/main/php_compat.h   Sun Feb 25 18:48:19 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_compat.h,v 1.31 2007/01/01 09:29:35 sebastian Exp $ */
+/* $Id: php_compat.h,v 1.32 2007/02/25 18:48:19 nlopess Exp $ */
 
 #ifndef PHP_COMPAT_H
 #define PHP_COMPAT_H
@@ -32,7 +32,7 @@
 #define pcre_compile2  php_pcre_compile2
 #define pcre_copy_substringphp_pcre_copy_substring
 #define pcre_exec  php_pcre_exec
-#define pcre_get_substring php_pcre_substring
+#define pcre_get_substring php_pcre_get_substring
 #define pcre_get_substring_listphp_pcre_get_substring_list
 #define pcre_info  php_pcre_info
 #define pcre_maketablesphp_pcre_maketables
@@ -43,7 +43,6 @@
 #define pcre_mallocphp_pcre_malloc
 #define pcre_configphp_pcre_config
 #define pcre_copy_named_substring php_pcre_copy_named_substring
-#define pcre_dfa_exec  php_pcre_dfa_exec
 #define pcre_free_substringphp_pcre_free_substring
 #define pcre_free_substring_list php_pcre_free_substring_list
 #define pcre_get_named_substring php_pcre_get_named_substring
@@ -55,6 +54,22 @@
 #define _pcre_ucp_othercasephp__pcre_ucp_othercase
 #define _pcre_valid_utf8   php__pcre_valid_utf8
 #define _pcre_xclass   php__pcre_xclass
+#define pcre_callout   php_pcre_callout
+#define _pcre_OP_lengths   php__pcre_OP_lengths
+/* this one doesn't work because pcre.h isn't included from the 
pcre_chartables.c file
+#define _pcre_default_tables   php__pcre_default_tables */
+#define pcre_get_stringtable_entries   php_pcre_get_stringtable_entries
+#define _pcre_is_newline   php__pcre_is_newline
+#define pcre_stack_freephp_pcre_stack_free
+#define pcre_stack_malloc  php_pcre_stack_malloc
+#define _pcre_utf8_table1  php__pcre_utf8_table1
+#define _pcre_utf8_table1_size php__pcre_utf8_table1_size
+#define _pcre_utf8_table2  php__pcre_utf8_table2
+#define _pcre_utf8_table3  php__pcre_utf8_table3
+#define _pcre_utf8_table4  php__pcre_utf8_table4
+#define _pcre_utt  php__pcre_utt
+#define _pcre_utt_size php__pcre_utt_size
+#define _pcre_was_newline  php__pcre_was_newline
 #endif
 
 #define lookup php_lookup

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /main php_compat.h

2007-02-25 Thread Nuno Lopes
nlopess Sun Feb 25 18:47:21 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main   php_compat.h 
  Log:
  update pcre symbols list
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.25.2.3.2.3&r2=1.25.2.3.2.4&diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.25.2.3.2.3 
php-src/main/php_compat.h:1.25.2.3.2.4
--- php-src/main/php_compat.h:1.25.2.3.2.3  Mon Jan  1 09:36:11 2007
+++ php-src/main/php_compat.h   Sun Feb 25 18:47:21 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_compat.h,v 1.25.2.3.2.3 2007/01/01 09:36:11 sebastian Exp $ */
+/* $Id: php_compat.h,v 1.25.2.3.2.4 2007/02/25 18:47:21 nlopess Exp $ */
 
 #ifndef PHP_COMPAT_H
 #define PHP_COMPAT_H
@@ -32,7 +32,7 @@
 #define pcre_compile2  php_pcre_compile2
 #define pcre_copy_substringphp_pcre_copy_substring
 #define pcre_exec  php_pcre_exec
-#define pcre_get_substring php_pcre_substring
+#define pcre_get_substring php_pcre_get_substring
 #define pcre_get_substring_listphp_pcre_get_substring_list
 #define pcre_info  php_pcre_info
 #define pcre_maketablesphp_pcre_maketables
@@ -43,7 +43,6 @@
 #define pcre_mallocphp_pcre_malloc
 #define pcre_configphp_pcre_config
 #define pcre_copy_named_substring php_pcre_copy_named_substring
-#define pcre_dfa_exec  php_pcre_dfa_exec
 #define pcre_free_substringphp_pcre_free_substring
 #define pcre_free_substring_list php_pcre_free_substring_list
 #define pcre_get_named_substring php_pcre_get_named_substring
@@ -55,6 +54,22 @@
 #define _pcre_ucp_othercasephp__pcre_ucp_othercase
 #define _pcre_valid_utf8   php__pcre_valid_utf8
 #define _pcre_xclass   php__pcre_xclass
+#define pcre_callout   php_pcre_callout
+#define _pcre_OP_lengths   php__pcre_OP_lengths
+/* this one doesn't work because pcre.h isn't included from the 
pcre_chartables.c file
+#define _pcre_default_tables   php__pcre_default_tables */
+#define pcre_get_stringtable_entries   php_pcre_get_stringtable_entries
+#define _pcre_is_newline   php__pcre_is_newline
+#define pcre_stack_freephp_pcre_stack_free
+#define pcre_stack_malloc  php_pcre_stack_malloc
+#define _pcre_utf8_table1  php__pcre_utf8_table1
+#define _pcre_utf8_table1_size php__pcre_utf8_table1_size
+#define _pcre_utf8_table2  php__pcre_utf8_table2
+#define _pcre_utf8_table3  php__pcre_utf8_table3
+#define _pcre_utf8_table4  php__pcre_utf8_table4
+#define _pcre_utt  php__pcre_utt
+#define _pcre_utt_size php__pcre_utt_size
+#define _pcre_was_newline  php__pcre_was_newline
 #endif
 
 #define lookup php_lookup

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions proc_open02.phpt

2007-02-22 Thread Nuno Lopes
nlopess Thu Feb 22 11:49:23 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   proc_open02.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
diff -u php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.4 
php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.5
--- php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.4   Wed Feb 
21 16:27:12 2007
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt   Thu Feb 
22 11:49:23 2007
@@ -15,6 +15,8 @@
$pipes
 );
 
+sleep(1); // let the OS run the nohup process before sending the signal
+
 var_dump(proc_terminate($cat, 1)); // send a SIGHUP
 sleep(1);
 var_dump(proc_get_status($cat));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/general_functions proc_open02.phpt

2007-02-22 Thread Nuno Lopes
nlopess Thu Feb 22 11:48:15 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/general_functions   proc_open02.phpt 
  Log:
  fix test on ultra-fast-machines and/or SOs with long time slices
  # Thanks Tony
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
diff -u php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.1.2.2 
php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.1.2.3
--- php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.1.2.2   
Wed Feb 21 16:25:37 2007
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt   Thu Feb 
22 11:48:14 2007
@@ -15,6 +15,8 @@
$pipes
 );
 
+sleep(1); // let the OS run the nohup process before sending the signal
+
 var_dump(proc_terminate($cat, 1)); // send a SIGHUP
 sleep(1);
 var_dump(proc_get_status($cat));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/general_functions proc_open02.phpt

2007-02-21 Thread Nuno Lopes

On 02/21/2007 07:25 PM, Nuno Lopes wrote:

nlopess Wed Feb 21 16:25:37 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/general_functions proc_open02.phpt


The test fails on three different Linuxes I have here.


Thanks for the report, Tony. This test also failed once on my laptop, but I 
was still wondering why.
Can you please try to add a 'sleep(1);' call after the proc_open()? My guess 
is that PHP is sending the SIGHUP signal before the nohup program sets the 
signal bitmasks. Adding the 'sleep(1)' call should make the OS run the nohup 
process.


Nuno 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions proc_open02.phpt

2007-02-21 Thread Nuno Lopes
nlopess Wed Feb 21 16:27:12 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   proc_open02.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
diff -u php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.3 
php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.4
--- php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.3   Wed Feb 
14 19:29:33 2007
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt   Wed Feb 
21 16:27:12 2007
@@ -3,14 +3,14 @@
 --SKIPIF--
 
 --FILE--
 
-  string(24) "/bin/nohup /bin/sleep 50"
+  string(28) "/usr/bin/nohup /bin/sleep 50"
   ["pid"]=>
   int(%d)
   ["running"]=>
@@ -51,7 +51,7 @@
 bool(true)
 array(8) {
   ["command"]=>
-  string(24) "/bin/nohup /bin/sleep 50"
+  string(28) "/usr/bin/nohup /bin/sleep 50"
   ["pid"]=>
   int(%d)
   ["running"]=>
@@ -72,7 +72,7 @@
 bool(true)
 array(8) {
   [u"command"]=>
-  unicode(24) "/bin/nohup /bin/sleep 50"
+  unicode(28) "/usr/bin/nohup /bin/sleep 50"
   [u"pid"]=>
   int(%d)
   [u"running"]=>
@@ -91,7 +91,7 @@
 bool(true)
 array(8) {
   [u"command"]=>
-  unicode(24) "/bin/nohup /bin/sleep 50"
+  unicode(28) "/usr/bin/nohup /bin/sleep 50"
   [u"pid"]=>
   int(%d)
   [u"running"]=>

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/general_functions proc_open02.phpt

2007-02-21 Thread Nuno Lopes
nlopess Wed Feb 21 16:25:37 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/general_functions   proc_open02.phpt 
  Log:
  use /usr/bin/nohup instead
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
diff -u php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.1.2.1 
php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.1.2.2
--- php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.1.2.1   
Wed Feb 14 19:13:31 2007
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt   Wed Feb 
21 16:25:37 2007
@@ -3,14 +3,14 @@
 --SKIPIF--
 
 --FILE--
 
-  string(24) "/bin/nohup /bin/sleep 50"
+  string(28) "/usr/bin/nohup /bin/sleep 50"
   ["pid"]=>
   int(%d)
   ["running"]=>
@@ -51,7 +51,7 @@
 bool(true)
 array(8) {
   ["command"]=>
-  string(24) "/bin/nohup /bin/sleep 50"
+  string(28) "/usr/bin/nohup /bin/sleep 50"
   ["pid"]=>
   int(%d)
   ["running"]=>

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_sqlite/sqlite/src parse.c

2007-02-21 Thread Nuno Lopes
nlopess Wed Feb 21 16:08:19 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_sqlite/sqlite/src  parse.c 
  Log:
  fix gcov build (#line stuff)
  http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite/src/parse.c?r1=1.6.2.5.2.5&r2=1.6.2.5.2.6&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite/src/parse.c
diff -u php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.5 
php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.6
--- php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.5   Tue Feb 20 
00:09:43 2007
+++ php-src/ext/pdo_sqlite/sqlite/src/parse.c   Wed Feb 21 16:08:18 2007
@@ -4,7 +4,7 @@
 /* First off, code is include which follows the "include" declaration
 ** in the input file. */
 #include 
-#line 56 "parse.y"
+#line 56 "ext/pdo_sqlite/sqlite/src/parse.y"
 
 #include "sqliteInt.h"
 #include "parse.h"
@@ -43,7 +43,7 @@
 */
 struct AttachKey { int type;  Token key; };
 
-#line 48 "parse.c"
+#line 48 "ext/pdo_sqlite/sqlite/src/parse.c"
 /* Next is all token values, in a form suitable for use by makeheaders.
 ** This section will be null unless lemon is run with the -m switch.
 */
@@ -1250,9 +1250,9 @@
 case 156:
 case 190:
 case 207:
-#line 375 "parse.y"
+#line 375 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SelectDelete((yypminor->yy43));}
-#line 1257 "parse.c"
+#line 1257 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 170:
 case 171:
@@ -1265,9 +1265,9 @@
 case 223:
 case 224:
 case 236:
-#line 616 "parse.y"
+#line 616 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy450));}
-#line 1272 "parse.c"
+#line 1272 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 175:
 case 183:
@@ -1280,48 +1280,48 @@
 case 213:
 case 216:
 case 222:
-#line 856 "parse.y"
+#line 856 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprListDelete((yypminor->yy242));}
-#line 1287 "parse.c"
+#line 1287 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 189:
 case 194:
 case 202:
 case 203:
-#line 488 "parse.y"
+#line 488 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SrcListDelete((yypminor->yy419));}
-#line 1295 "parse.c"
+#line 1295 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 199:
-#line 546 "parse.y"
+#line 546 "ext/pdo_sqlite/sqlite/src/parse.y"
 {
   sqlite3ExprDelete((yypminor->yy84).pLimit);
   sqlite3ExprDelete((yypminor->yy84).pOffset);
 }
-#line 1303 "parse.c"
+#line 1303 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 206:
 case 209:
 case 215:
-#line 505 "parse.y"
+#line 505 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy352));}
-#line 1310 "parse.c"
+#line 1310 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 232:
 case 237:
-#line 957 "parse.y"
+#line 957 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3DeleteTriggerStep((yypminor->yy75));}
-#line 1316 "parse.c"
+#line 1316 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 234:
-#line 941 "parse.y"
+#line 941 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy354).b);}
-#line 1321 "parse.c"
+#line 1321 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 239:
-#line 1025 "parse.y"
+#line 1025 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy158));}
-#line 1326 "parse.c"
+#line 1326 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 default:  break;   /* If no destructor action specified: do nothing */
   }
@@ -1485,11 +1485,11 @@
  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will execute if the parser
  ** stack every overflows */
-#line 44 "parse.y"
+#line 44 "ext/pdo_sqlite/sqlite/src/parse.y"
 
   sqlite3ErrorMsg(pParse, "parser stack overflow");
   pParse->parseError = 1;
-#line 1495 "parse.c"
+#line 1495 "ext/pdo_sqlite/sqlite/src/parse.c"
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument 
var */
  return;
   }
@@ -1882,61 +1882,61 @@
   ** break;
   */
   case 3:
-#line 100 "parse.y"
+#line 100 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3FinishCoding(pParse); }
-#line 1890 "parse.c"
+#line 1890 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 6:
-#line 103 "parse.y"
+#line 103 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 0); }
-#line 1895 "parse.c"
+#line 1895 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 7:
-#line 105 "parse.y"
+#line 105 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 1); }
-#line 1900 "parse.c"
+#line 1900 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 8:
-#line 106 "parse.y"
+#line 106 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 2); }
-#line 1905 "parse.c"
+#line 1905 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 9:
-#line 112 "parse.y"
+#line 112 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.y

Re: [PHP-CVS] cvs: php-src /ext/standard assert.c basic_functions.c

2007-02-16 Thread Nuno Lopes

So where is the test? *hint* :-)

- Original Message - 

Really this patch fixes a SIGSEGV.
I'll try to look how to optimize it.

Thanks. Dmitry.


-Original Message-
From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 16, 2007 4:47 PM

To: Dmitry Stogov
Cc: php-cvs@lists.php.net
Subject: Re: [PHP-CVS] cvs: php-src /ext/standard assert.c 
basic_functions.c 



Dmitry,

Please revert this patch. The code adds RINIT that hits every 
request  
for functionality that is only needed for testing of the code and is  
otherwise rarely used. I do not believe it warrants slowing down  
every single request, even by a little bit.



On 16-Feb-07, at 8:12 AM, Dmitry Stogov wrote:

> dmitry Fri Feb 16 13:12:55 2007 UTC
>
>   Modified files:
> /php-src/ext/standard assert.c basic_functions.c
>   Log:
>   Fixed return value of assert_options(ASSERT_CALLBACK) and
> possible crash (Andy Wharmby)
>
>
> http://cvs.php.net/viewvc.cgi/php-src/ext/standard/assert.c? 
> r1=1.71&r2=1.72&diff_format=u

> Index: php-src/ext/standard/assert.c
> diff -u php-src/ext/standard/assert.c:1.71 php-src/ext/standard/ 
> assert.c:1.72

> --- php-src/ext/standard/assert.c:1.71 Mon Jan  1 09:29:30 2007
> +++ php-src/ext/standard/assert.c Fri Feb 16 13:12:55 2007
> @@ -16,7 +16,7 @@
>  
> 
+-
 
> -+

>   */
>
> -/* $Id: assert.c,v 1.71 2007/01/01 09:29:30 sebastian Exp $ */
> +/* $Id: assert.c,v 1.72 2007/02/16 13:12:55 dmitry Exp $ */
>
>  /* {{{ includes/startup/misc */
>
> @@ -114,6 +114,16 @@
>  return SUCCESS;
>  }
>
> +PHP_RINIT_FUNCTION(assert)
> +{
> + if (ASSERTG(cb)) {
> + MAKE_STD_ZVAL(ASSERTG(callback));
> + ZVAL_STRING(ASSERTG(callback), ASSERTG(cb), 1);
> + }
> +
> + return SUCCESS;
> +}
> +
>  PHP_RSHUTDOWN_FUNCTION(assert)
>  {
>  if (ASSERTG(callback)) {
> @@ -202,11 +212,6 @@
>  RETURN_TRUE;
>  }
>
> - if (!ASSERTG(callback) && ASSERTG(cb)) {
> - MAKE_STD_ZVAL(ASSERTG(callback));
> - ZVAL_STRING(ASSERTG(callback), ASSERTG(cb), 1);
> - }
> -
>  if (ASSERTG(callback)) {
>  zval *args[3];
>  zval *retval;
> @@ -309,6 +314,11 @@
>  break;
>
>  case ASSERT_CALLBACK:
> + if (ASSERTG(callback) != NULL) {
> + RETVAL_ZVAL(ASSERTG(callback), 1, 0);
> + } else {
> + RETVAL_NULL();
> + }
>  if (ac == 2) {
>  if (ASSERTG(callback)) {
>  zval_ptr_dtor(&ASSERTG(callback));
> @@ -316,7 +326,7 @@
>  ASSERTG(callback) = *value;
>  zval_add_ref(value);
>  }
> - RETURN_TRUE;
> + return;
>  break;
>
>  default:
> http://cvs.php.net/viewvc.cgi/php-src/ext/standard/ 
> basic_functions.c?r1=1.846&r2=1.847&diff_format=u

> Index: php-src/ext/standard/basic_functions.c
> diff -u php-src/ext/standard/basic_functions.c:1.846 php-src/ext/ 
> standard/basic_functions.c:1.847
> --- php-src/ext/standard/basic_functions.c:1.846 Thu Feb  8  
> 15:31:01 2007

> +++ php-src/ext/standard/basic_functions.c Fri Feb 16 13:12:55 2007
> @@ -17,7 +17,7 @@
>  
> 
+-
 
> -+

>   */
>
> -/* $Id: basic_functions.c,v 1.846 2007/02/08 15:31:01 
helly Exp $ */
> +/* $Id: basic_functions.c,v 1.847 2007/02/16 13:12:55 
dmitry Exp $ */

>
>  #include "php.h"
>  #include "php_streams.h"
> @@ -4147,6 +4147,7 @@
>  #ifdef HAVE_SYSLOG_H
>  PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
>  #endif
> + PHP_RINIT(assert) (INIT_FUNC_ARGS_PASSTHRU);
>  PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
>  PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
>
>
> -- 
> PHP CVS Mailing List (http://www.php.net/)

> To unsubscribe, visit: http://www.php.net/unsub.php
>

Ilia Alshanetsky


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/pdo_sqlite config.m4

2007-02-15 Thread Nuno Lopes
nlopess Thu Feb 15 20:53:26 2007 UTC

  Modified files:  
/php-src/ext/pdo_sqlite config.m4 
  Log:
  MFB: fix build on cygwin with windows-style EOLs
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/config.m4?r1=1.32&r2=1.33&diff_format=u
Index: php-src/ext/pdo_sqlite/config.m4
diff -u php-src/ext/pdo_sqlite/config.m4:1.32 
php-src/ext/pdo_sqlite/config.m4:1.33
--- php-src/ext/pdo_sqlite/config.m4:1.32   Sat Dec 23 18:00:49 2006
+++ php-src/ext/pdo_sqlite/config.m4Thu Feb 15 20:53:26 2007
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.32 2006/12/23 18:00:49 derick Exp $
+dnl $Id: config.m4,v 1.33 2007/02/15 20:53:26 nlopess Exp $
 dnl config.m4 for extension pdo_sqlite
 dnl vim:et:sw=2:ts=2:
 
@@ -89,7 +89,7 @@
   PHP_ADD_BUILD_DIR($ext_builddir/sqlite/src, 1)
   AC_CHECK_SIZEOF(char *,4)
   AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer])
-  PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION`
+  PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION | sed 's/[^0-9.]//g'`
   PDO_SQLITE_VERSION_NUMBER=`echo $PDO_SQLITE_VERSION | $AWK -F. 
'{printf("%d%03d%03d", $1, $2, $3)}'`
   sed -e s/--VERS--/$PDO_SQLITE_VERSION/ -e 
s/--VERSION-NUMBER--/$PDO_SQLITE_VERSION_NUMBER/ 
$ext_srcdir/sqlite/src/sqlite.h.in > $ext_builddir/sqlite/src/sqlite3.h
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_sqlite config.m4

2007-02-15 Thread Nuno Lopes
nlopess Thu Feb 15 20:52:50 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_sqlite config.m4 
  Log:
  fix build on cygwin with windows-style EOLs
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/config.m4?r1=1.26.2.9.2.3&r2=1.26.2.9.2.4&diff_format=u
Index: php-src/ext/pdo_sqlite/config.m4
diff -u php-src/ext/pdo_sqlite/config.m4:1.26.2.9.2.3 
php-src/ext/pdo_sqlite/config.m4:1.26.2.9.2.4
--- php-src/ext/pdo_sqlite/config.m4:1.26.2.9.2.3   Sat Dec 23 17:58:47 2006
+++ php-src/ext/pdo_sqlite/config.m4Thu Feb 15 20:52:50 2007
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.26.2.9.2.3 2006/12/23 17:58:47 derick Exp $
+dnl $Id: config.m4,v 1.26.2.9.2.4 2007/02/15 20:52:50 nlopess Exp $
 dnl config.m4 for extension pdo_sqlite
 dnl vim:et:sw=2:ts=2:
 
@@ -89,7 +89,7 @@
   PHP_ADD_BUILD_DIR($ext_builddir/sqlite/src, 1)
   AC_CHECK_SIZEOF(char *,4)
   AC_DEFINE(SQLITE_PTR_SZ, SIZEOF_CHAR_P, [Size of a pointer])
-  PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION`
+  PDO_SQLITE_VERSION=`cat $ext_srcdir/sqlite/VERSION | sed 's/[^0-9.]//g'`
   PDO_SQLITE_VERSION_NUMBER=`echo $PDO_SQLITE_VERSION | $AWK -F. 
'{printf("%d%03d%03d", $1, $2, $3)}'`
   sed -e s/--VERS--/$PDO_SQLITE_VERSION/ -e 
s/--VERSION-NUMBER--/$PDO_SQLITE_VERSION_NUMBER/ 
$ext_srcdir/sqlite/src/sqlite.h.in > $ext_srcdir/sqlite/src/sqlite3.h
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /build build.mk

2007-02-15 Thread Nuno Lopes
nlopess Thu Feb 15 20:43:19 2007 UTC

  Modified files:  
/php-src/build  build.mk 
  Log:
  MFB: fix cvsclean on cygwin with windows-style EOLs
  
http://cvs.php.net/viewvc.cgi/php-src/build/build.mk?r1=1.28&r2=1.29&diff_format=u
Index: php-src/build/build.mk
diff -u php-src/build/build.mk:1.28 php-src/build/build.mk:1.29
--- php-src/build/build.mk:1.28 Sun Jan  1 13:09:48 2006
+++ php-src/build/build.mk  Thu Feb 15 20:43:19 2007
@@ -14,7 +14,7 @@
 #  | Author: Sascha Schumann <[EMAIL PROTECTED]> |
 #  +--+
 #
-# $Id: build.mk,v 1.28 2006/01/01 13:09:48 sniper Exp $ 
+# $Id: build.mk,v 1.29 2007/02/15 20:43:19 nlopess Exp $ 
 #
 #
 # Makefile to generate build tools
@@ -67,7 +67,7 @@
 
 cvsclean-work:
@for i in `find . -name .cvsignore`; do \
-   (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep 
-v config.nice` *.o *.a .libs || true); \
+   (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep 
-v config.nice | sed 's/[\r\n]/ /g'` *.o *.a .libs || true); \
done
 
 .PHONY: $(ALWAYS) snapshot

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /build build.mk

2007-02-15 Thread Nuno Lopes
nlopess Thu Feb 15 20:42:24 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/build  build.mk 
  Log:
  fix cvsclean on cygwin with windows-style EOLs
  
http://cvs.php.net/viewvc.cgi/php-src/build/build.mk?r1=1.26.2.2.2.1&r2=1.26.2.2.2.2&diff_format=u
Index: php-src/build/build.mk
diff -u php-src/build/build.mk:1.26.2.2.2.1 php-src/build/build.mk:1.26.2.2.2.2
--- php-src/build/build.mk:1.26.2.2.2.1 Mon Jan  1 19:32:10 2007
+++ php-src/build/build.mk  Thu Feb 15 20:42:24 2007
@@ -14,7 +14,7 @@
 #  | Author: Sascha Schumann <[EMAIL PROTECTED]> |
 #  +--+
 #
-# $Id: build.mk,v 1.26.2.2.2.1 2007/01/01 19:32:10 iliaa Exp $ 
+# $Id: build.mk,v 1.26.2.2.2.2 2007/02/15 20:42:24 nlopess Exp $ 
 #
 #
 # Makefile to generate build tools
@@ -67,7 +67,7 @@
 
 cvsclean-work:
@for i in `find . -name .cvsignore`; do \
-   (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep 
-v config.nice` *.o *.a .libs || true); \
+   (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep 
-v config.nice | sed 's/[\r\n]/ /g'` *.o *.a .libs || true); \
done
 
 .PHONY: $(ALWAYS) snapshot

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions bug39322.phpt bug40398.phpt error_get_last.phpt proc_open02.phpt

2007-02-14 Thread Nuno Lopes
nlopess Wed Feb 14 19:29:34 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   bug39322.phpt 
bug40398.phpt 
error_get_last.phpt 
proc_open02.phpt 
  Log:
  fix a few tests in unicode mode
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug39322.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/general_functions/bug39322.phpt
diff -u php-src/ext/standard/tests/general_functions/bug39322.phpt:1.2 
php-src/ext/standard/tests/general_functions/bug39322.phpt:1.3
--- php-src/ext/standard/tests/general_functions/bug39322.phpt:1.2  Wed Feb 
14 19:20:15 2007
+++ php-src/ext/standard/tests/general_functions/bug39322.phpt  Wed Feb 14 
19:29:33 2007
@@ -42,3 +42,23 @@
   int(0)
 }
 Done!
+--UEXPECTF--
+array(8) {
+  [u"command"]=>
+  unicode(14) "/bin/sleep 120"
+  [u"pid"]=>
+  int(%d)
+  [u"running"]=>
+  bool(false)
+  [u"signaled"]=>
+  bool(true)
+  [u"stopped"]=>
+  bool(false)
+  [u"exitcode"]=>
+  int(-1)
+  [u"termsig"]=>
+  int(15)
+  [u"stopsig"]=>
+  int(0)
+}
+Done!
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug40398.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/general_functions/bug40398.phpt
diff -u php-src/ext/standard/tests/general_functions/bug40398.phpt:1.2 
php-src/ext/standard/tests/general_functions/bug40398.phpt:1.3
--- php-src/ext/standard/tests/general_functions/bug40398.phpt:1.2  Thu Feb 
 8 15:31:01 2007
+++ php-src/ext/standard/tests/general_functions/bug40398.phpt  Wed Feb 14 
19:29:33 2007
@@ -86,3 +86,15 @@
 
 Warning: call_user_func_array() expects parameter 1 to be valid callback, 
array given in %sbug40398.php on line %d
 ===DONE===
+--UEXPECTF--
+Base::__construct(1)
+Base::__construct(2)
+
+Warning: call_user_func_array() expects parameter 1 to be valid callback, 
Unicode string given in %sbug40398.php on line %d
+
+Warning: call_user_func_array() expects parameter 1 to be valid callback, 
Unicode string given in %sbug40398.php on line %d
+
+Warning: call_user_func_array() expects parameter 1 to be valid callback, 
array given in %sbug40398.php on line %d
+
+Warning: call_user_func_array() expects parameter 1 to be valid callback, 
array given in %sbug40398.php on line %d
+===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/error_get_last.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/error_get_last.phpt
diff -u php-src/ext/standard/tests/general_functions/error_get_last.phpt:1.1 
php-src/ext/standard/tests/general_functions/error_get_last.phpt:1.2
--- php-src/ext/standard/tests/general_functions/error_get_last.phpt:1.1
Thu Nov 16 13:00:03 2006
+++ php-src/ext/standard/tests/general_functions/error_get_last.phptWed Feb 
14 19:29:33 2007
@@ -13,7 +13,7 @@
 
 echo "Done\n";
 ?>
---EXPECTF--
+--EXPECTF--
 NULL
 
 Warning: error_get_last() expects exactly 0 parameters, 1 given in %s on line 
%d
@@ -41,3 +41,31 @@
   int(%d)
 }
 Done
+--UEXPECTF--
+NULL
+
+Warning: error_get_last() expects exactly 0 parameters, 1 given in %s on line 
%d
+NULL
+array(4) {
+  [u"type"]=>
+  int(2)
+  [u"message"]=>
+  unicode(54) "error_get_last() expects exactly 0 parameters, 1 given"
+  [u"file"]=>
+  unicode(%d) "%s"
+  [u"line"]=>
+  int(%d)
+}
+
+Notice: Undefined variable: b in %s on line %d
+array(4) {
+  [u"type"]=>
+  int(8)
+  [u"message"]=>
+  unicode(21) "Undefined variable: b"
+  [u"file"]=>
+  unicode(%d) "%s"
+  [u"line"]=>
+  int(%d)
+}
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
diff -u php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.2 
php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.3
--- php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.2   Wed Feb 
14 19:20:15 2007
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt   Wed Feb 
14 19:29:33 2007
@@ -68,3 +68,43 @@
   int(0)
 }
 Done!
+--UEXPECTF--
+bool(true)
+array(8) {
+  [u"command"]=>
+  unicode(24) "/bin/nohup /bin/sleep 50"
+  [u"pid"]=>
+  int(%d)
+  [u"running"]=>
+  bool(true)
+  [u"signaled"]=>
+  bool(false)
+  [u"stopped"]=>
+  bool(false)
+  [u"exitcode"]=>
+  int(-1)
+  [u"termsig"]=>
+  int(0)
+  [u"stopsig"]=>
+  int(0)
+}
+bool(true)
+array(8) {
+  [u"command"]=>
+  unicode(24) "/bin/nohup /bin/sleep 50"
+  [u"pid"]=>
+  int(%d)
+  [u"running"]=>
+  bool(false)
+  [u"signaled"]=>
+  bool(true)
+  [u"stopped"]=>
+  bool(false)
+  [u"exitcode"]=>
+  int(-1)
+  [u"termsig"]=>
+  int(15)
+  [u"stopsig"]=>
+  int(0)
+}
+Done!

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://w

[PHP-CVS] cvs: php-src /ext/standard proc_open.c /ext/standard/tests/general_functions bug39322.phpt phpcredits.phpt proc_open02.phpt

2007-02-14 Thread Nuno Lopes
nlopess Wed Feb 14 19:20:15 2007 UTC

  Modified files:  
/php-src/ext/standard   proc_open.c 
/php-src/ext/standard/tests/general_functions   bug39322.phpt 
proc_open02.phpt 
phpcredits.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.52&r2=1.53&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.52 
php-src/ext/standard/proc_open.c:1.53
--- php-src/ext/standard/proc_open.c:1.52   Tue Feb 13 19:56:42 2007
+++ php-src/ext/standard/proc_open.cWed Feb 14 19:20:14 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: proc_open.c,v 1.52 2007/02/13 19:56:42 nlopess Exp $ */
+/* $Id: proc_open.c,v 1.53 2007/02/14 19:20:14 nlopess Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE   /* linux wants this when XOPEN mode is on */
@@ -253,7 +253,7 @@
 }
 /* }}} */
 
-/* {{{ proto int proc_terminate(resource process [, long signal]) U
+/* {{{ proto bool proc_terminate(resource process [, long signal]) U
kill a process opened by proc_open */
 PHP_FUNCTION(proc_terminate)
 {
@@ -268,13 +268,18 @@
ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, 
"process", le_proc_open);

 #ifdef PHP_WIN32
-   TerminateProcess(proc->childHandle, 255);
+   if (TerminateProcess(proc->childHandle, 255)) {
+   RETURN_TRUE;
+   } else {
+   RETURN_FALSE;
+   }
 #else
-   kill(proc->child, sig_no);
+   if (kill(proc->child, sig_no) == 0) {
+   RETURN_TRUE;
+   } else {
+   RETURN_FALSE;
+   }
 #endif
-   
-   zend_list_delete(Z_LVAL_P(zproc));
-   RETURN_LONG(FG(pclose_ret));
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug39322.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/bug39322.phpt
diff -u /dev/null php-src/ext/standard/tests/general_functions/bug39322.phpt:1.2
--- /dev/null   Wed Feb 14 19:20:15 2007
+++ php-src/ext/standard/tests/general_functions/bug39322.phpt  Wed Feb 14 
19:20:15 2007
@@ -0,0 +1,44 @@
+--TEST--
+bug #39322: proc_terminate() loosing process resource
+--SKIPIF--
+
+--FILE--
+ array('pipe', 'r'),
+1 => array('pipe', 'w'),
+2 => array('pipe', 'w'));
+
+$pipes = array();
+
+$process = proc_open('/bin/sleep 120', $descriptors, $pipes);
+
+proc_terminate($process);
+sleep(1); // wait a bit to let the process finish
+var_dump(proc_get_status($process));
+
+echo "Done!\n";
+
+?>
+--EXPECTF--
+array(8) {
+  ["command"]=>
+  string(14) "/bin/sleep 120"
+  ["pid"]=>
+  int(%d)
+  ["running"]=>
+  bool(false)
+  ["signaled"]=>
+  bool(true)
+  ["stopped"]=>
+  bool(false)
+  ["exitcode"]=>
+  int(-1)
+  ["termsig"]=>
+  int(15)
+  ["stopsig"]=>
+  int(0)
+}
+Done!
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
diff -u /dev/null 
php-src/ext/standard/tests/general_functions/proc_open02.phpt:1.2
--- /dev/null   Wed Feb 14 19:20:15 2007
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt   Wed Feb 
14 19:20:15 2007
@@ -0,0 +1,70 @@
+--TEST--
+proc_open
+--SKIPIF--
+
+--FILE--
+
+--EXPECTF--
+bool(true)
+array(8) {
+  ["command"]=>
+  string(24) "/bin/nohup /bin/sleep 50"
+  ["pid"]=>
+  int(%d)
+  ["running"]=>
+  bool(true)
+  ["signaled"]=>
+  bool(false)
+  ["stopped"]=>
+  bool(false)
+  ["exitcode"]=>
+  int(-1)
+  ["termsig"]=>
+  int(0)
+  ["stopsig"]=>
+  int(0)
+}
+bool(true)
+array(8) {
+  ["command"]=>
+  string(24) "/bin/nohup /bin/sleep 50"
+  ["pid"]=>
+  int(%d)
+  ["running"]=>
+  bool(false)
+  ["signaled"]=>
+  bool(true)
+  ["stopped"]=>
+  bool(false)
+  ["exitcode"]=>
+  int(-1)
+  ["termsig"]=>
+  int(15)
+  ["stopsig"]=>
+  int(0)
+}
+Done!
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/phpcredits.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/general_functions/phpcredits.phpt
diff -u php-src/ext/standard/tests/general_functions/phpcredits.phpt:1.2 
php-src/ext/standard/tests/general_functions/phpcredits.phpt:1.3
--- php-src/ext/standard/tests/general_functions/phpcredits.phpt:1.2Fri Nov 
24 20:20:51 2006
+++ php-src/ext/standard/tests/general_functions/phpcredits.phptWed Feb 
14 19:20:15 2007
@@ -22,7 +22,7 @@
 Language Design & Concept
 %s
 
-%wPHP %d Authors%w
+%wPHP Authors%w
 %s
 
 %wSAPI Modules%w

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard proc_open.c /ext/standard/tests/general_functions bug39322.phpt proc_open02.phpt

2007-02-14 Thread Nuno Lopes
nlopess Wed Feb 14 19:13:31 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/general_functions   bug39322.phpt 
proc_open02.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   proc_open.c 
  Log:
  Fixed bug #39322 (proc_terminate() destroys process resource)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.537&r2=1.2027.2.547.2.538&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.537 php-src/NEWS:1.2027.2.547.2.538
--- php-src/NEWS:1.2027.2.547.2.537 Tue Feb 13 19:53:42 2007
+++ php-src/NEWSWed Feb 14 19:13:31 2007
@@ -16,6 +16,7 @@
 - Fixed bug #40410 (ext/posix does not compile on MacOS 10.3.9). (Tony)
 - Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony)
 - Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus)
+- Fixed bug #39322 (proc_terminate() destroys process resource). (Nuno)
 - Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection). (Nuno)
 - Fixed bug #34794 (proc_close() hangs when used with two processes).
   (jdolecek at netbsd dot org, Nuno)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.10&r2=1.36.2.1.2.11&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.36.2.1.2.10 
php-src/ext/standard/proc_open.c:1.36.2.1.2.11
--- php-src/ext/standard/proc_open.c:1.36.2.1.2.10  Tue Feb 13 19:53:42 2007
+++ php-src/ext/standard/proc_open.cWed Feb 14 19:13:31 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: proc_open.c,v 1.36.2.1.2.10 2007/02/13 19:53:42 nlopess Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.11 2007/02/14 19:13:31 nlopess Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE   /* linux wants this when XOPEN mode is on */
@@ -300,7 +300,7 @@
 }
 /* }}} */
 
-/* {{{ proto int proc_terminate(resource process [, long signal])
+/* {{{ proto bool proc_terminate(resource process [, long signal])
kill a process opened by proc_open */
 PHP_FUNCTION(proc_terminate)
 {
@@ -315,13 +315,18 @@
ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, 
"process", le_proc_open);

 #ifdef PHP_WIN32
-   TerminateProcess(proc->childHandle, 255);
+   if (TerminateProcess(proc->childHandle, 255)) {
+   RETURN_TRUE;
+   } else {
+   RETURN_FALSE;
+   }
 #else
-   kill(proc->child, sig_no);
+   if (kill(proc->child, sig_no) == 0) {
+   RETURN_TRUE;
+   } else {
+   RETURN_FALSE;
+   }
 #endif
-   
-   zend_list_delete(Z_LVAL_P(zproc));
-   RETURN_LONG(FG(pclose_ret));
 }
 /* }}} */
 

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug39322.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/bug39322.phpt
+++ php-src/ext/standard/tests/general_functions/bug39322.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/proc_open02.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/proc_open02.phpt
+++ php-src/ext/standard/tests/general_functions/proc_open02.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard proc_open.c /ext/standard/tests/general_functions bug34794.phpt

2007-02-13 Thread Nuno Lopes
nlopess Tue Feb 13 19:56:42 2007 UTC

  Modified files:  
/php-src/ext/standard   proc_open.c 
/php-src/ext/standard/tests/general_functions   bug34794.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.51&r2=1.52&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.51 
php-src/ext/standard/proc_open.c:1.52
--- php-src/ext/standard/proc_open.c:1.51   Tue Jan  9 16:27:32 2007
+++ php-src/ext/standard/proc_open.cTue Feb 13 19:56:42 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: proc_open.c,v 1.51 2007/01/09 16:27:32 dmitry Exp $ */
+/* $Id: proc_open.c,v 1.52 2007/02/13 19:56:42 nlopess Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE   /* linux wants this when XOPEN mode is on */
@@ -945,6 +945,10 @@

descriptors[i].mode_flags), mode_string, NULL);
 #else
stream = 
php_stream_fopen_from_fd(descriptors[i].parentend, mode_string, NULL);
+# if defined(F_SETFD) && defined(FD_CLOEXEC)
+   /* mark the descriptor close-on-exec, so that 
it won't be inherited by potential other children */
+   fcntl(descriptors[i].parentend, F_SETFD, 
FD_CLOEXEC);
+# endif
 #endif
if (stream) {
zval *retfp;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug34794.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/bug34794.phpt
diff -u /dev/null php-src/ext/standard/tests/general_functions/bug34794.phpt:1.2
--- /dev/null   Tue Feb 13 19:56:42 2007
+++ php-src/ext/standard/tests/general_functions/bug34794.phpt  Tue Feb 13 
19:56:42 2007
@@ -0,0 +1,34 @@
+--TEST--
+bug #34794: proc_close() hangs when used with two processes
+--SKIPIF--
+
+--FILE--
+ array('pipe', 'r'), 1 
=>array('pipe', 'r')), $pipes1);
+
+echo "Opening process 2\n";
+$process2 = proc_open('/bin/cat', array(0 => array('pipe', 'r'), 1 
=>array('pipe', 'r')), $pipes2);
+
+
+echo "Closing process 1\n";
+fclose($pipes1[0]);
+fclose($pipes1[1]);
+proc_close($process1);
+
+echo "Closing process 2\n";
+fclose($pipes2[0]);
+fclose($pipes2[1]);
+proc_close($process2);
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+Opening process 1
+Opening process 2
+Closing process 1
+Closing process 2
+Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard proc_open.c /ext/standard/tests/general_functions bug34794.phpt

2007-02-13 Thread Nuno Lopes
nlopess Tue Feb 13 19:53:42 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/general_functions   bug34794.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   proc_open.c 
  Log:
  Fixed bug #34794 (proc_close() hangs when used with two processes)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.536&r2=1.2027.2.547.2.537&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.536 php-src/NEWS:1.2027.2.547.2.537
--- php-src/NEWS:1.2027.2.547.2.536 Tue Feb 13 18:29:10 2007
+++ php-src/NEWSTue Feb 13 19:53:42 2007
@@ -17,6 +17,8 @@
 - Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony)
 - Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus)
 - Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection). (Nuno)
+- Fixed bug #34794 (proc_close() hangs when used with two processes).
+  (jdolecek at netbsd dot org, Nuno)
 
 08 Feb 2007, PHP 5.2.1
 - Added read-timeout context option "timeout" for HTTP streams. (Hannes, 
Ilia). 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.9&r2=1.36.2.1.2.10&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.36.2.1.2.9 
php-src/ext/standard/proc_open.c:1.36.2.1.2.10
--- php-src/ext/standard/proc_open.c:1.36.2.1.2.9   Tue Feb 13 15:55:45 2007
+++ php-src/ext/standard/proc_open.cTue Feb 13 19:53:42 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: proc_open.c,v 1.36.2.1.2.9 2007/02/13 15:55:45 tony2001 Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.10 2007/02/13 19:53:42 nlopess Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE   /* linux wants this when XOPEN mode is on */
@@ -943,6 +943,10 @@

descriptors[i].mode_flags), mode_string, NULL);
 #else
stream = 
php_stream_fopen_from_fd(descriptors[i].parentend, mode_string, NULL);
+# if defined(F_SETFD) && defined(FD_CLOEXEC)
+   /* mark the descriptor close-on-exec, so that 
it won't be inherited by potential other children */
+   fcntl(descriptors[i].parentend, F_SETFD, 
FD_CLOEXEC);
+# endif
 #endif
if (stream) {
zval *retfp;

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug34794.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/bug34794.phpt
+++ php-src/ext/standard/tests/general_functions/bug34794.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ftp ftp.c /ext/ftp/tests bug37799.phpt server.inc

2007-02-13 Thread Nuno Lopes
nlopess Tue Feb 13 18:30:19 2007 UTC

  Modified files:  
/php-src/ext/ftpftp.c 
/php-src/ext/ftp/tests  bug37799.phpt server.inc 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/ftp.c?r1=1.120&r2=1.121&diff_format=u
Index: php-src/ext/ftp/ftp.c
diff -u php-src/ext/ftp/ftp.c:1.120 php-src/ext/ftp/ftp.c:1.121
--- php-src/ext/ftp/ftp.c:1.120 Mon Jan  1 09:29:23 2007
+++ php-src/ext/ftp/ftp.c   Tue Feb 13 18:30:19 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: ftp.c,v 1.120 2007/01/01 09:29:23 sebastian Exp $ */
+/* $Id: ftp.c,v 1.121 2007/02/13 18:30:19 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -266,60 +266,57 @@
}

if (ftp->resp != 334) {
-   ftp->use_ssl = 0;
+   return 0;
} else {
ftp->old_ssl = 1;
ftp->use_ssl_for_data = 1;
}
}

-   /* now enable ssl if we still need to */
-   if (ftp->use_ssl) {
-   ctx = SSL_CTX_new(SSLv23_client_method());
-   if (ctx == NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"failed to create the SSL context");
+   ctx = SSL_CTX_new(SSLv23_client_method());
+   if (ctx == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to 
create the SSL context");
+   return 0;
+   }
+
+   SSL_CTX_set_options(ctx, SSL_OP_ALL);
+
+   ftp->ssl_handle = SSL_new(ctx);
+   if (ftp->ssl_handle == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to 
create the SSL handle");
+   SSL_CTX_free(ctx);
+   return 0;
+   }
+
+   SSL_set_fd(ftp->ssl_handle, ftp->fd);
+
+   if (SSL_connect(ftp->ssl_handle) <= 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS 
handshake failed");
+   SSL_shutdown(ftp->ssl_handle);
+   return 0;
+   }
+
+   ftp->ssl_active = 1;
+
+   if (!ftp->old_ssl) {
+
+   /* set protection buffersize to zero */
+   if (!ftp_putcmd(ftp, "PBSZ", "0")) {
+   return 0;
+   }
+   if (!ftp_getresp(ftp)) {
return 0;
}
 
-   SSL_CTX_set_options(ctx, SSL_OP_ALL);
-
-   ftp->ssl_handle = SSL_new(ctx);
-   if (ftp->ssl_handle == NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"failed to create the SSL handle");
-   SSL_CTX_free(ctx);
+   /* enable data conn encryption */
+   if (!ftp_putcmd(ftp, "PROT", "P")) {
return 0;
}
-   
-   SSL_set_fd(ftp->ssl_handle, ftp->fd);
-   
-   if (SSL_connect(ftp->ssl_handle) <= 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"SSL/TLS handshake failed");
-   SSL_shutdown(ftp->ssl_handle);
+   if (!ftp_getresp(ftp)) {
return 0;
}

-   ftp->ssl_active = 1;
-   
-   if (!ftp->old_ssl) {
-   
-   /* set protection buffersize to zero */
-   if (!ftp_putcmd(ftp, "PBSZ", "0")) {
-   return 0;
-   }
-   if (!ftp_getresp(ftp)) {
-   return 0;
-   }
-   
-   /* enable data conn encryption */
-   if (!ftp_putcmd(ftp, "PROT", "P")) {
-   return 0;
-   }
-   if (!ftp_getresp(ftp)) {
-   return 0;
-   }
-   
-   ftp->use_ssl_for_data = (ftp->resp >= 200 && 
ftp->resp <=299);  
-   }
+   ftp->use_ssl_for_data = (ftp->resp >= 200 && ftp->resp 
<=299);  
  

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/ftp ftp.c /ext/ftp/tests bug37799.phpt server.inc

2007-02-13 Thread Nuno Lopes
nlopess Tue Feb 13 18:29:10 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/ftp/tests  bug37799.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/ftpftp.c 
/php-src/ext/ftp/tests  server.inc 
  Log:
  Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.535&r2=1.2027.2.547.2.536&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.535 php-src/NEWS:1.2027.2.547.2.536
--- php-src/NEWS:1.2027.2.547.2.535 Tue Feb 13 15:55:45 2007
+++ php-src/NEWSTue Feb 13 18:29:10 2007
@@ -16,6 +16,7 @@
 - Fixed bug #40410 (ext/posix does not compile on MacOS 10.3.9). (Tony)
 - Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony)
 - Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus)
+- Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection). (Nuno)
 
 08 Feb 2007, PHP 5.2.1
 - Added read-timeout context option "timeout" for HTTP streams. (Hannes, 
Ilia). 
http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/ftp.c?r1=1.112.2.4.2.3&r2=1.112.2.4.2.4&diff_format=u
Index: php-src/ext/ftp/ftp.c
diff -u php-src/ext/ftp/ftp.c:1.112.2.4.2.3 php-src/ext/ftp/ftp.c:1.112.2.4.2.4
--- php-src/ext/ftp/ftp.c:1.112.2.4.2.3 Mon Jan  1 09:36:01 2007
+++ php-src/ext/ftp/ftp.c   Tue Feb 13 18:29:10 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: ftp.c,v 1.112.2.4.2.3 2007/01/01 09:36:01 sebastian Exp $ */
+/* $Id: ftp.c,v 1.112.2.4.2.4 2007/02/13 18:29:10 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -266,60 +266,57 @@
}

if (ftp->resp != 334) {
-   ftp->use_ssl = 0;
+   return 0;
} else {
ftp->old_ssl = 1;
ftp->use_ssl_for_data = 1;
}
}

-   /* now enable ssl if we still need to */
-   if (ftp->use_ssl) {
-   ctx = SSL_CTX_new(SSLv23_client_method());
-   if (ctx == NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"failed to create the SSL context");
+   ctx = SSL_CTX_new(SSLv23_client_method());
+   if (ctx == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to 
create the SSL context");
+   return 0;
+   }
+
+   SSL_CTX_set_options(ctx, SSL_OP_ALL);
+
+   ftp->ssl_handle = SSL_new(ctx);
+   if (ftp->ssl_handle == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to 
create the SSL handle");
+   SSL_CTX_free(ctx);
+   return 0;
+   }
+
+   SSL_set_fd(ftp->ssl_handle, ftp->fd);
+
+   if (SSL_connect(ftp->ssl_handle) <= 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS 
handshake failed");
+   SSL_shutdown(ftp->ssl_handle);
+   return 0;
+   }
+
+   ftp->ssl_active = 1;
+
+   if (!ftp->old_ssl) {
+
+   /* set protection buffersize to zero */
+   if (!ftp_putcmd(ftp, "PBSZ", "0")) {
+   return 0;
+   }
+   if (!ftp_getresp(ftp)) {
return 0;
}
 
-   SSL_CTX_set_options(ctx, SSL_OP_ALL);
-
-   ftp->ssl_handle = SSL_new(ctx);
-   if (ftp->ssl_handle == NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"failed to create the SSL handle");
-   SSL_CTX_free(ctx);
+   /* enable data conn encryption */
+   if (!ftp_putcmd(ftp, "PROT", "P")) {
return 0;
}
-   
-   SSL_set_fd(ftp->ssl_handle, ftp->fd);
-   
-   if (SSL_connect(ftp->ssl_handle) <= 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"SSL/TLS handshake failed");
-   SSL_shutdown(ftp->ssl_handle);
+   if (!ftp_getresp(ftp)) {
return 0;
}

-   ftp->ssl_active = 1;
-   
-   if (!ftp->old_ssl) {
-   
-   /* set protection buffersize to zero */
-   

[PHP-CVS] cvs: php-src /ext/tidy/tests 019.phpt 028.phpt

2007-02-11 Thread Nuno Lopes
nlopess Sun Feb 11 16:12:00 2007 UTC

  Modified files:  
/php-src/ext/tidy/tests 028.phpt 019.phpt 
  Log:
  sync tests with php 5.2
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/028.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/tidy/tests/028.phpt
diff -u /dev/null php-src/ext/tidy/tests/028.phpt:1.2
--- /dev/null   Sun Feb 11 16:12:00 2007
+++ php-src/ext/tidy/tests/028.phpt Sun Feb 11 16:12:00 2007
@@ -0,0 +1,19 @@
+--TEST--
+tidyNode::getParent()
+--SKIPIF--
+
+--FILE--
+Content");
+var_dump($x->body()->child[0]->name);
+var_dump($x->body()->child[0]->getParent()->name);
+var_dump($x->root()->getParent());
+?>
+--EXPECT--
+string(3) "div"
+string(4) "body"
+NULL
+--UEXPECT--
+unicode(3) "div"
+unicode(4) "body"
+NULL
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/019.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/tidy/tests/019.phpt
diff -u php-src/ext/tidy/tests/019.phpt:1.2 php-src/ext/tidy/tests/019.phpt:1.3
--- php-src/ext/tidy/tests/019.phpt:1.2 Thu Feb  8 16:37:52 2007
+++ php-src/ext/tidy/tests/019.phpt Sun Feb 11 16:12:00 2007
@@ -1,16 +1,55 @@
 --TEST--
-Test getParent()
+tidy_repair_*() and invalid parameters
 --SKIPIF--
 
 --FILE--
 Content");
-var_dump($x->body()->child[0]->name);
-var_dump($x->body()->child[0]->getParent()->name);
+
+$l = 1;
+$s = "";
+$a = array();
+
+tidy_repair_string($s, $l, $l, $l);
+tidy_repair_string($s, $s, $s, $s);
+tidy_repair_string($l, $l, $l ,$l);
+tidy_repair_string($a, $a, $a, $a);
+
+tidy_repair_file($s, $l, $l, $l);
+tidy_repair_file($s, $s, $s, $s);
+tidy_repair_file($l, $l, $l ,$l);
+tidy_repair_file($a, $a, $a, $a);
+
+echo "Done\n";
 ?>
---EXPECT--
-string(3) "div"
-string(4) "body"
---UEXPECT--
-unicode(3) "div"
-unicode(4) "body"
+--EXPECTF--
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on 
line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '' in %s on 
line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on 
line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string() expects parameter 1 to be string, array given in 
%s on line %d
+
+Warning: tidy_repair_file() expects parameter 1 to be string, array given in 
%s on line %d
+Done
+--UEXPECTF--
+Warning: tidy_repair_string(): Could not load configuration file '1' in 
%s019.php on line 7
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s019.php on line 
7
+
+Warning: tidy_repair_string() expects parameter 4 to be boolean, Unicode 
string given in %s019.php on line 8
+
+Warning: tidy_repair_string(): Could not load configuration file '1' in 
%s019.php on line 9
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s019.php on line 
9
+
+Warning: tidy_repair_string() expects parameter 1 to be binary string, array 
given in %s019.php on line 10
+
+Warning: tidy_repair_file() expects parameter 4 to be boolean, Unicode string 
given in %s019.php on line 13
+
+Warning: tidy_repair_file() expects parameter 1 to be binary string, array 
given in %s019.php on line 15
+Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/tidy tidy.c /ext/tidy/tests 028.phpt

2007-02-11 Thread Nuno Lopes
nlopess Sun Feb 11 16:07:31 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/tidy/tests 028.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/tidy   tidy.c 
  Log:
  merge the tidyNode::getParent() patch from HEAD
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.530&r2=1.2027.2.547.2.531&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.530 php-src/NEWS:1.2027.2.547.2.531
--- php-src/NEWS:1.2027.2.547.2.530 Sun Feb 11 11:11:48 2007
+++ php-src/NEWSSun Feb 11 16:07:30 2007
@@ -4,6 +4,7 @@
 - Upgraded SQLite 3 to version 3.3.12 (Ilia)
 - Upgraded PCRE to version 7.0 (Nuno)
 - Add --ri switch to CLI which allows to check extension information. (Marcus)
+- Added tidyNode::getParent() method (John, Nuno)
 - Fixed bug #40431 (dynamic properties may cause crash in ReflectionProperty 
   methods). (Tony)
 - Fixed bug #40428, imagepstext() doesn't accept optional parameter (Pierre)
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.21&r2=1.66.2.8.2.22&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.21 
php-src/ext/tidy/tidy.c:1.66.2.8.2.22
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.21   Tue Jan 23 19:23:29 2007
+++ php-src/ext/tidy/tidy.c Sun Feb 11 16:07:30 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.21 2007/01/23 19:23:29 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.22 2007/02/11 16:07:30 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -267,6 +267,7 @@
 static TIDY_NODE_METHOD(isJste);
 static TIDY_NODE_METHOD(isAsp);
 static TIDY_NODE_METHOD(isPhp);
+static TIDY_NODE_METHOD(getParent);
 /* }}} */
 
 ZEND_DECLARE_MODULE_GLOBALS(tidy)
@@ -341,6 +342,7 @@
TIDY_NODE_ME(isJste, NULL)
TIDY_NODE_ME(isAsp, NULL)
TIDY_NODE_ME(isPhp, NULL)
+   TIDY_NODE_ME(getParent, NULL)
{NULL, NULL, NULL}
 };
 
@@ -990,7 +992,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.21 2007/01/23 19:23:29 
nlopess Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.22 2007/02/11 16:07:30 
nlopess Exp $)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1659,6 +1661,29 @@
 }
 /* }}} */
 
+/* {{{ proto tidyNode tidyNode::getParent()
+   Returns the parent node if available or NULL */
+static TIDY_NODE_METHOD(getParent)
+{
+   TidyNodeparent_node;
+   PHPTidyObj *newobj;
+   TIDY_FETCH_ONLY_OBJECT;
+
+   parent_node = tidyGetParent(obj->node);
+   if(parent_node) {
+   tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC);
+   newobj = (PHPTidyObj *) 
zend_object_store_get_object(return_value TSRMLS_CC);
+   newobj->node = parent_node;
+   newobj->type = is_node;
+   newobj->ptdoc = obj->ptdoc;
+   newobj->ptdoc->ref_count++;
+   tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+   } else {
+   ZVAL_NULL(return_value);
+   }
+}
+/* }}} */
+
 static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS)
 {
TIDY_NODE_CONST(ROOT, Root);

http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/028.phpt?view=markup&rev=1.1
Index: php-src/ext/tidy/tests/028.phpt
+++ php-src/ext/tidy/tests/028.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pdo_sqlite/sqlite/src parse.c

2007-02-10 Thread Nuno Lopes
nlopess Sat Feb 10 20:26:09 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_sqlite/sqlite/src  parse.c 
  Log:
  fix gcov build (#line directives)
  http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite/src/parse.c?r1=1.6.2.5.2.3&r2=1.6.2.5.2.4&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite/src/parse.c
diff -u php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.3 
php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.4
--- php-src/ext/pdo_sqlite/sqlite/src/parse.c:1.6.2.5.2.3   Fri Feb  9 
03:17:46 2007
+++ php-src/ext/pdo_sqlite/sqlite/src/parse.c   Sat Feb 10 20:26:09 2007
@@ -4,7 +4,7 @@
 /* First off, code is include which follows the "include" declaration
 ** in the input file. */
 #include 
-#line 56 "parse.y"
+#line 56 "ext/pdo_sqlite/sqlite/src/parse.y"
 
 #include "sqliteInt.h"
 #include "parse.h"
@@ -43,7 +43,7 @@
 */
 struct AttachKey { int type;  Token key; };
 
-#line 48 "parse.c"
+#line 48 "ext/pdo_sqlite/sqlite/src/parse.c"
 /* Next is all token values, in a form suitable for use by makeheaders.
 ** This section will be null unless lemon is run with the -m switch.
 */
@@ -1245,9 +1245,9 @@
 case 156:
 case 190:
 case 207:
-#line 374 "parse.y"
+#line 374 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SelectDelete((yypminor->yy43));}
-#line 1252 "parse.c"
+#line 1252 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 170:
 case 171:
@@ -1260,9 +1260,9 @@
 case 224:
 case 225:
 case 236:
-#line 618 "parse.y"
+#line 618 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy450));}
-#line 1267 "parse.c"
+#line 1267 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 175:
 case 183:
@@ -1275,48 +1275,48 @@
 case 214:
 case 217:
 case 223:
-#line 855 "parse.y"
+#line 855 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprListDelete((yypminor->yy242));}
-#line 1282 "parse.c"
+#line 1282 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 189:
 case 194:
 case 202:
 case 203:
-#line 487 "parse.y"
+#line 487 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3SrcListDelete((yypminor->yy419));}
-#line 1290 "parse.c"
+#line 1290 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 199:
-#line 548 "parse.y"
+#line 548 "ext/pdo_sqlite/sqlite/src/parse.y"
 {
   sqlite3ExprDelete((yypminor->yy84).pLimit);
   sqlite3ExprDelete((yypminor->yy84).pOffset);
 }
-#line 1298 "parse.c"
+#line 1298 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 206:
 case 209:
 case 216:
-#line 504 "parse.y"
+#line 504 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy352));}
-#line 1305 "parse.c"
+#line 1305 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 232:
 case 237:
-#line 952 "parse.y"
+#line 952 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3DeleteTriggerStep((yypminor->yy75));}
-#line 1311 "parse.c"
+#line 1311 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 234:
-#line 936 "parse.y"
+#line 936 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3IdListDelete((yypminor->yy354).b);}
-#line 1316 "parse.c"
+#line 1316 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 case 239:
-#line 1020 "parse.y"
+#line 1020 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3ExprDelete((yypminor->yy158));}
-#line 1321 "parse.c"
+#line 1321 "ext/pdo_sqlite/sqlite/src/parse.c"
   break;
 default:  break;   /* If no destructor action specified: do nothing */
   }
@@ -1480,11 +1480,11 @@
  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will execute if the parser
  ** stack every overflows */
-#line 44 "parse.y"
+#line 44 "ext/pdo_sqlite/sqlite/src/parse.y"
 
   sqlite3ErrorMsg(pParse, "parser stack overflow");
   pParse->parseError = 1;
-#line 1490 "parse.c"
+#line 1490 "ext/pdo_sqlite/sqlite/src/parse.c"
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument 
var */
  return;
   }
@@ -1876,61 +1876,61 @@
   ** break;
   */
   case 3:
-#line 100 "parse.y"
+#line 100 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3FinishCoding(pParse); }
-#line 1884 "parse.c"
+#line 1884 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 6:
-#line 103 "parse.y"
+#line 103 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 0); }
-#line 1889 "parse.c"
+#line 1889 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 7:
-#line 105 "parse.y"
+#line 105 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 1); }
-#line 1894 "parse.c"
+#line 1894 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 8:
-#line 106 "parse.y"
+#line 106 "ext/pdo_sqlite/sqlite/src/parse.y"
 { sqlite3BeginParse(pParse, 2); }
-#line 1899 "parse.c"
+#line 1899 "ext/pdo_sqlite/sqlite/src/parse.c"
 break;
   case 9:
-#line 112 "parse.y"
+#line 112 "ext/pdo_sqlite/sqlite/src/parse.y"
 {sqlite3BeginTransaction(pParse, yymsp[-1].mi

[PHP-CVS] cvs: php-src(PHP_4_4) /ext/imap config.m4

2007-02-10 Thread Nuno Lopes
nlopess Sat Feb 10 20:57:29 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/imap   config.m4 
  Log:
  fix typos
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/config.m4?r1=1.49.2.15.2.1&r2=1.49.2.15.2.2&diff_format=u
Index: php-src/ext/imap/config.m4
diff -u php-src/ext/imap/config.m4:1.49.2.15.2.1 
php-src/ext/imap/config.m4:1.49.2.15.2.2
--- php-src/ext/imap/config.m4:1.49.2.15.2.1Mon Jan 29 10:08:17 2007
+++ php-src/ext/imap/config.m4  Sat Feb 10 20:57:29 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.49.2.15.2.1 2007/01/29 10:08:17 tony2001 Exp $
+dnl $Id: config.m4,v 1.49.2.15.2.2 2007/02/10 20:57:29 nlopess Exp $
 dnl
 
 AC_DEFUN([IMAP_INC_CHK],[if test -r "$i$1/c-client.h"; then
@@ -146,7 +146,7 @@
 if test "$ac_cv_utf8_mime2text" = "new"; then
   AC_DEFINE(HAVE_NEW_MIME2TEXT, 1, [Whether utf8_mime2text() has new 
signature])
 fi
-CFLAGS=$old_CPPFLAGS
+CFLAGS=$old_CFLAGS
 
 old_CFLAGS=$CFLAGS
 CFLAGS="-I$IMAP_INC_DIR"
@@ -161,7 +161,7 @@
  ac_cv_u8t_canonical=no
   ])
 )
-CFLAGS=$old_CPPFLAGS
+CFLAGS=$old_CFLAGS
 
 if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = 
"new"; then
 AC_MSG_ERROR([utf8_mime2text() has new signature, but U8T_CANONICAL is 
missing. This should not happen. Check config.log for additional information.])

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pcre/tests bug40195.phpt

2007-02-09 Thread Nuno Lopes
nlopess Fri Feb  9 20:00:17 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/pcre/tests bug40195.phpt 
  Log:
  new test to keep track of the reported pcre regression
  

http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug40195.phpt?view=markup&rev=1.1
Index: php-src/ext/pcre/tests/bug40195.phpt
+++ php-src/ext/pcre/tests/bug40195.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c /ext/tidy/tests 004.phpt 007.phpt 010.phpt 011.phpt 012.phpt 019.phpt 024.phpt 025.phpt 027.phpt

2007-02-08 Thread Nuno Lopes
nlopess Thu Feb  8 16:37:52 2007 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
/php-src/ext/tidy/tests 004.phpt 007.phpt 010.phpt 011.phpt 
012.phpt 019.phpt 024.phpt 025.phpt 
027.phpt 
  Log:
  fix a few tests (segfaults + wrong output)
  http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.111&r2=1.112&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.111 php-src/ext/tidy/tidy.c:1.112
--- php-src/ext/tidy/tidy.c:1.111   Tue Jan 23 19:50:14 2007
+++ php-src/ext/tidy/tidy.c Thu Feb  8 16:37:52 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.111 2007/01/23 19:50:14 nlopess Exp $ */
+/* $Id: tidy.c,v 1.112 2007/02/08 16:37:52 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -420,7 +420,7 @@
case TidyString:
if (Z_TYPE(conv) != IS_STRING) {
zval_copy_ctor(&conv);
-   convert_to_string(&conv);
+   convert_to_string_with_converter(&conv, 
UG(ascii_conv));
}
if (tidyOptSetValue(doc, tidyOptGetId(opt), 
Z_STRVAL(conv))) {
if (Z_TYPE(conv) != Z_TYPE_P(value)) {
@@ -696,6 +696,7 @@
 
case IS_UNICODE:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
+   tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
ZVAL_U_STRINGL(obj->converter->conv, out, (char *) 
output.bp, output.size ? output.size-1 : 0, 1);
tidyBufFree(&output);
@@ -731,20 +732,23 @@
tidyBufInit(&buf);
if (obj->ptdoc) {
tidyNodeGetText(obj->ptdoc->doc, obj->node, 
&buf);
-   ZVAL_STRINGL(out, (char *) buf.bp, buf.size-1, 
0);
+   ZVAL_STRINGL(out, (char *) buf.bp, buf.size-1, 
1);
} else {
ZVAL_EMPTY_STRING(out);
}
+   tidyBufFree(&buf);
break;
 
case IS_UNICODE:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
+   tidyBufInit(&buf);
if (obj->ptdoc) {
tidyNodeGetText(obj->ptdoc->doc, obj->node, 
&buf);
-   ZVAL_U_STRINGL(obj->converter->conv, out, (char 
*) buf.bp, buf.size-1, 0);
+   ZVAL_U_STRINGL(obj->converter->conv, out, (char 
*) buf.bp, buf.size ? buf.size-1 : 0, 1);
} else {
ZVAL_EMPTY_UNICODE(out);
}
+   tidyBufFree(&buf);
break;
 
default:
@@ -795,7 +799,7 @@
case is_node:
tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
-   ADD_PROPERTY_STRINGL(obj->converter->conv, 
obj->std.properties, value, buf.bp, buf.size-1);
+   ADD_PROPERTY_STRINGL(obj->converter->conv, 
obj->std.properties, value, buf.bp, buf.size ? buf.size-1 : 0);
tidyBufFree(&buf);
 
ADD_PROPERTY_ASCII_STRING(obj->std.properties, name, 
tidyNodeGetName(obj->node));
@@ -847,6 +851,8 @@
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
+   newobj->converter = obj->converter;
+   if (obj->converter) 
obj->converter->ref_count++;
 
tidy_add_default_properties(newobj, 
is_node TSRMLS_CC);
add_next_index_zval(children, temp);
@@ -906,6 +912,8 @@
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
+   newobj->converter = obj->converter;
+   if (obj->converter) obj->converter->ref_count++;
 
switch(node) {
case is_root_node:
@@ -1048,7 +1056,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.111 2007/01/23 19:50:14 nlopess Exp 
$)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c

[PHP-CVS] cvs: php-src / run-tests.php

2007-02-08 Thread Nuno Lopes
nlopess Thu Feb  8 15:25:17 2007 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  MFB: remove ereg() calls
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.314&r2=1.315&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.314 php-src/run-tests.php:1.315
--- php-src/run-tests.php:1.314 Tue Jan 30 17:41:11 2007
+++ php-src/run-tests.php   Thu Feb  8 15:25:17 2007
@@ -23,7 +23,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.314 2007/01/30 17:41:11 nlopess Exp $ */
+/* $Id: run-tests.php,v 1.315 2007/02/08 15:25:17 nlopess Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -401,7 +401,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.314 $'."\n";
+   echo '$Revision: 1.315 $'."\n";
exit(1);
default:
echo "Illegal switch specified!\n";
@@ -522,7 +522,7 @@
if ($html_output) {
fclose($html_file);
}
-   if (getenv('REPORT_EXIT_STATUS') == 1 and ereg('FAILED( |$)', 
implode(' ', $test_results))) {
+   if (getenv('REPORT_EXIT_STATUS') == 1 and 
preg_match('/FAILED(?: |$)/', implode(' ', $test_results))) {
exit(1);
}
exit(0);
@@ -986,7 +986,7 @@
$bork_info = "empty test [$file]";
$borked = true;
}
-   if (!ereg('^--TEST--',$line,$r)) {
+   if (strncmp('--TEST--', $line, 8)) {
$bork_info = "tests must start with --TEST-- [$file]";
$borked = true;
}
@@ -1011,7 +1011,7 @@
}
 
// End of actual test?
-   if ($secfile && preg_match('/^===DONE===/', $line, $r)) {
+   if ($secfile && preg_match('/^===DONE===$/', $line)) {
$secdone = true;
}
}
@@ -1207,10 +1207,9 @@
if (!$cfg['keep']['skip']) {
@unlink($test_skipif);
}
-   if (!strncasecmp('skip', trim($output), 4)) {
-   $reason = (eregi("^skip[[:space:]]*(.+)\$", 
trim($output))) ? eregi_replace("^skip[[:space:]]*(.+)\$", "\\1", 
trim($output)) : FALSE;
-   if ($reason) {
-   show_result("SKIP", $tested, 
$tested_file, $unicode_semantics, "reason: $reason", $temp_filenames);
+   if (!strncasecmp('skip', ltrim($output), 4)) {
+   if (preg_match('/^\s*skip\s*(.+)\s*/i', 
$output, $m)) {
+   show_result("SKIP", $tested, 
$tested_file, $unicode_semantics, "reason: $m[1]", $temp_filenames);
} else {
show_result("SKIP", $tested, 
$tested_file, $unicode_semantics, '', $temp_filenames);
}
@@ -1222,17 +1221,15 @@
}
return 'SKIPPED';
}
-   if (!strncasecmp('info', trim($output), 4)) {
-   $reason = (ereg("^info[[:space:]]*(.+)\$", 
trim($output))) ? ereg_replace("^info[[:space:]]*(.+)\$", "\\1", trim($output)) 
: FALSE;
-   if ($reason) {
-   $info = " (info: $reason)";
+   if (!strncasecmp('info', ltrim($output), 4)) {
+   if (preg_match('/^\s*info\s*(.+)\s*/i', 
$output, $m)) {
+   $info = " (info: $m[1])";
}
}
-   if (!strncasecmp('warn', trim($output), 4)) {
-   $reason = (ereg("^warn[[:space:]]*(.+)\$", 
trim($output))) ? ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output)) 
: FALSE;
-   if ($reason) {
+   if (!strncasecmp('warn', ltrim($output), 4)) {
+   if (preg_match('/^\s*warn\s*(.+)\s*/i', 
$output, $m)) {
$warn = true; /* only if there is a 
reason */
-   $info = " (warn: $reason)";
+   $info = " (warn: $m[1])";
}
}
}
@@ -1357,8 

[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php

2007-02-08 Thread Nuno Lopes
nlopess Thu Feb  8 15:22:03 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcrun-tests.php 
  Log:
  convert all ereg*() calls to preg_match(), so that we become future-proof 
(ereg is scheduled for removal in PHP 6)
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.22&r2=1.226.2.37.2.23&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.22 
php-src/run-tests.php:1.226.2.37.2.23
--- php-src/run-tests.php:1.226.2.37.2.22   Wed Feb  7 11:31:22 2007
+++ php-src/run-tests.php   Thu Feb  8 15:22:03 2007
@@ -23,7 +23,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.22 2007/02/07 11:31:22 nlopess Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.23 2007/02/08 15:22:03 nlopess Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -398,7 +398,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.22 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.23 
$'."\n";
exit(1);
default:
echo "Illegal switch '$switch' 
specified!\n";
@@ -518,7 +518,7 @@
if ($html_output) {
fclose($html_file);
}
-   if (getenv('REPORT_EXIT_STATUS') == 1 and ereg('FAILED( |$)', 
implode(' ', $test_results))) {
+   if (getenv('REPORT_EXIT_STATUS') == 1 and 
preg_match('/FAILED(?: |$)/', implode(' ', $test_results))) {
exit(1);
}
exit(0);
@@ -968,7 +968,7 @@
$bork_info = "empty test [$file]";
$borked = true;
}
-   if (!ereg('^--TEST--',$line,$r)) {
+   if (strncmp('--TEST--', $line, 8)) {
$bork_info = "tests must start with --TEST-- [$file]";
$borked = true;
}
@@ -993,7 +993,7 @@
}
 
// End of actual test?
-   if ($secfile && preg_match('/^===DONE===/', $line, $r)) {
+   if ($secfile && preg_match('/^===DONE===$/', $line)) {
$secdone = true;
}
}
@@ -1177,10 +1177,9 @@
if (!$cfg['keep']['skip']) {
@unlink($test_skipif);
}
-   if (!strncasecmp('skip', trim($output), 4)) {
-   $reason = (eregi("^skip[[:space:]]*(.+)\$", 
trim($output))) ? eregi_replace("^skip[[:space:]]*(.+)\$", "\\1", 
trim($output)) : FALSE;
-   if ($reason) {
-   show_result("SKIP", $tested, 
$tested_file, "reason: $reason", $temp_filenames);
+   if (!strncasecmp('skip', ltrim($output), 4)) {
+   if (preg_match('/^\s*skip\s*(.+)\s*/i', 
$output, $m)) {
+   show_result("SKIP", $tested, 
$tested_file, "reason: $m[1]", $temp_filenames);
} else {
show_result("SKIP", $tested, 
$tested_file, '', $temp_filenames);
}
@@ -1192,17 +1191,15 @@
}
return 'SKIPPED';
}
-   if (!strncasecmp('info', trim($output), 4)) {
-   $reason = (ereg("^info[[:space:]]*(.+)\$", 
trim($output))) ? ereg_replace("^info[[:space:]]*(.+)\$", "\\1", trim($output)) 
: FALSE;
-   if ($reason) {
-   $info = " (info: $reason)";
+   if (!strncasecmp('info', ltrim($output), 4)) {
+   if (preg_match('/^\s*info\s*(.+)\s*/i', 
$output, $m)) {
+   $info = " (info: $m[1])";
}
}
-   if (!strncasecmp('warn', trim($output), 4)) {
-   $reason = (ereg("^warn[[:space:]]*(.+)\$", 
trim($output))) ? ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output)) 
: FALSE;
-   if ($reason) {
+   if (!strncasecmp('warn', ltrim($output), 4)) {
+   if (preg_match('/^\s*warn\s*(.+)\s*/i', 
$output, $m)) {
$warn = true; /* only if there is a 
reason */
-   $info = " (warn: $reason)";

[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php

2007-02-07 Thread Nuno Lopes
nlopess Wed Feb  7 11:31:22 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcrun-tests.php 
  Log:
  MFH: use getenv() instead of _ENV
  enable multiple error reporting on the same test
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.21&r2=1.226.2.37.2.22&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.21 
php-src/run-tests.php:1.226.2.37.2.22
--- php-src/run-tests.php:1.226.2.37.2.21   Mon Jan  1 19:32:09 2007
+++ php-src/run-tests.php   Wed Feb  7 11:31:22 2007
@@ -23,7 +23,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.21 2007/01/01 19:32:09 iliaa Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.22 2007/02/07 11:31:22 nlopess Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -398,7 +398,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.226.2.37.2.21 
$'."\n";
+   echo '$Revision: 1.226.2.37.2.22 
$'."\n";
exit(1);
default:
echo "Illegal switch '$switch' 
specified!\n";
@@ -700,8 +700,8 @@
 
if (substr(PHP_OS, 0, 3) != "WIN") {
/* If PHP_AUTOCONF is set, use it; otherwise, use 
'autoconf'. */
-   if (!empty($_ENV['PHP_AUTOCONF'])) {
-   $autoconf = shell_exec($_ENV['PHP_AUTOCONF'] . 
' --version');
+   if (getenv('PHP_AUTOCONF')) {
+   $autoconf = shell_exec(getenv('PHP_AUTOCONF') . 
' --version');
} else {
$autoconf = shell_exec('autoconf --version');
}
@@ -1511,11 +1511,13 @@
}
 
if ($leaked) {
-   $restype = 'LEAK';
-   } else if ($warn) {
-   $restype = 'WARN';
-   } else {
-   $restype = 'FAIL';
+   $restype[] = 'LEAK';
+   }
+   if ($warn) {
+   $restype[] = 'WARN';
+   }
+   if (!$passed) {
+   $restype[] = 'FAIL';
}
 
if (!$passed) {
@@ -1547,21 +1549,23 @@
}
}
 
-   show_result($restype, $tested, $tested_file, $info, $temp_filenames);
+   show_result(implode('&', $restype), $tested, $tested_file, $info, 
$temp_filenames);
 
-   $PHP_FAILED_TESTS[$restype.'ED'][] = array (
+   foreach ($restype as $type) {
+   $PHP_FAILED_TESTS[$type.'ED'][] = array (
'name' => $file,
'test_name' => 
(is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested . " 
[$tested_file]",
'output' => $output_filename,
'diff'   => $diff_filename,
'info'   => $info,
);
+   }
 
if (isset($old_php)) {
$php = $old_php;
}
 
-   return $restype.'ED';
+   return $restype[0].'ED';
 }
 
 function comp_line($l1,$l2,$is_reg)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / run-tests.php

2007-01-30 Thread Nuno Lopes
nlopess Tue Jan 30 17:41:11 2007 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  use getenv() instead of the _ENV var
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.313&r2=1.314&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.313 php-src/run-tests.php:1.314
--- php-src/run-tests.php:1.313 Mon Jan 29 22:55:22 2007
+++ php-src/run-tests.php   Tue Jan 30 17:41:11 2007
@@ -23,7 +23,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.313 2007/01/29 22:55:22 nlopess Exp $ */
+/* $Id: run-tests.php,v 1.314 2007/01/30 17:41:11 nlopess Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -401,7 +401,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.313 $'."\n";
+   echo '$Revision: 1.314 $'."\n";
exit(1);
default:
echo "Illegal switch specified!\n";
@@ -704,8 +704,8 @@
 
if (substr(PHP_OS, 0, 3) != "WIN") {
/* If PHP_AUTOCONF is set, use it; otherwise, use 
'autoconf'. */
-   if (!empty($_ENV['PHP_AUTOCONF'])) {
-   $autoconf = shell_exec($_ENV['PHP_AUTOCONF'] . 
' --version');
+   if (getenv('PHP_AUTOCONF')) {
+   $autoconf = shell_exec(getenv('PHP_AUTOCONF') . 
' --version');
} else {
$autoconf = shell_exec('autoconf --version');
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / run-tests.php

2007-01-29 Thread Nuno Lopes
nlopess Mon Jan 29 22:55:22 2007 UTC

  Modified files:  
/php-srcrun-tests.php 
  Log:
  display all errors/leaks/warnings on each test, instead of showing just the 
top most error
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.312&r2=1.313&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.312 php-src/run-tests.php:1.313
--- php-src/run-tests.php:1.312 Thu Dec 28 15:06:58 2006
+++ php-src/run-tests.php   Mon Jan 29 22:55:22 2007
@@ -23,7 +23,7 @@
+--+
  */
 
-/* $Id: run-tests.php,v 1.312 2006/12/28 15:06:58 nlopess Exp $ */
+/* $Id: run-tests.php,v 1.313 2007/01/29 22:55:22 nlopess Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -401,7 +401,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
-   echo '$Revision: 1.312 $'."\n";
+   echo '$Revision: 1.313 $'."\n";
exit(1);
default:
echo "Illegal switch specified!\n";
@@ -1568,11 +1568,13 @@
}
 
if ($leaked) {
-   $restype = 'LEAK';
-   } else if ($warn) {
-   $restype = 'WARN';
-   } else {
-   $restype = 'FAIL';
+   $restype[] = 'LEAK';
+   }
+   if ($warn) {
+   $restype[] = 'WARN';
+   }
+   if (!$passed) {
+   $restype[] = 'FAIL';
}
 
if (!$passed) {
@@ -1604,9 +1606,10 @@
}
}
 
-   show_result($restype, $tested, $tested_file, $unicode_semantics, $info, 
$temp_filenames);
+   show_result(implode('&', $restype), $tested, $tested_file, 
$unicode_semantics, $info, $temp_filenames);
 
-   $PHP_FAILED_TESTS[$restype.'ED'][] = array (
+   foreach ($restype as $type) {
+   $PHP_FAILED_TESTS[$type.'ED'][] = array (
'name' => $file,
'test_name' => 
(is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested . " 
[$tested_file]",
'output' => $output_filename,
@@ -1614,12 +1617,13 @@
'info'   => $info,
'unicode'=> $unicode_semantics,
);
+   }
 
if (isset($old_php)) {
$php = $old_php;
}
 
-   return $restype.'ED';
+   return $restype[0].'ED';
 }
 
 function comp_line($l1,$l2,$is_reg)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/soap php_xml.c

2007-01-29 Thread Nuno Lopes
nlopess Mon Jan 29 19:36:53 2007 UTC

  Modified files:  
/php-src/ext/soap   php_xml.c 
  Log:
  fix access to already free'ed memory
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_xml.c?r1=1.32&r2=1.33&diff_format=u
Index: php-src/ext/soap/php_xml.c
diff -u php-src/ext/soap/php_xml.c:1.32 php-src/ext/soap/php_xml.c:1.33
--- php-src/ext/soap/php_xml.c:1.32 Wed Jan 24 21:43:47 2007
+++ php-src/ext/soap/php_xml.c  Mon Jan 29 19:36:53 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_xml.c,v 1.32 2007/01/24 21:43:47 pollita Exp $ */
+/* $Id: php_xml.c,v 1.33 2007/01/29 19:36:53 nlopess Exp $ */
 
 #include "php_soap.h"
 #include "libxml/parser.h"
@@ -87,12 +87,17 @@
 */
 
old_allow_url_fopen_list = PG(allow_url_fopen_list);
-   if (!old_allow_url_fopen_list) {
-   old_allow_url_fopen_list = "";
+   if (old_allow_url_fopen_list) {
+   old_allow_url_fopen_list = estrdup(old_allow_url_fopen_list);
+   } else {
+   old_allow_url_fopen_list = STR_EMPTY_ALLOC();
}
+
zend_alter_ini_entry("allow_url_fopen", sizeof("allow_url_fopen"), "*", 
1, PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME);
ctxt = xmlCreateFileParserCtxt(filename);
zend_alter_ini_entry("allow_url_fopen", sizeof("allow_url_fopen"), 
old_allow_url_fopen_list, strlen(old_allow_url_fopen_list), PHP_INI_SYSTEM, 
PHP_INI_STAGE_RUNTIME);
+   efree(old_allow_url_fopen_list);
+
if (ctxt) {
ctxt->keepBlanks = 0;
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c /ext/tidy/tests 027.phpt

2007-01-23 Thread Nuno Lopes
nlopess Tue Jan 23 19:50:14 2007 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
/php-src/ext/tidy/tests 027.phpt 
  Log:
  MFB: fix a few crashes
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.110&r2=1.111&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.110 php-src/ext/tidy/tidy.c:1.111
--- php-src/ext/tidy/tidy.c:1.110   Sat Jan 20 12:58:20 2007
+++ php-src/ext/tidy/tidy.c Tue Jan 23 19:50:14 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.110 2007/01/20 12:58:20 nlopess Exp $ */
+/* $Id: tidy.c,v 1.111 2007/01/23 19:50:14 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -42,7 +42,7 @@
 
 /* {{{ ext/tidy macros
 */
-#define FIX_BUFFER(bptr) (bptr)->bp[(bptr)->size-1] = '\0'
+#define FIX_BUFFER(bptr) do { if ((bptr)->size) { (bptr)->bp[(bptr)->size-1] = 
'\0'; } } while(0)
 
 #define TIDY_SET_CONTEXT \
 zval *object = getThis();
@@ -526,7 +526,7 @@
 
tidySaveBuffer (doc, &output);
FIX_BUFFER(&output);
-   RETVAL_STRINGL((char *) output.bp, 
output.size-1, 1);
+   RETVAL_STRINGL((char *) output.bp, output.size 
? output.size-1 : 0, 1);
tidyBufFree(&output);
} else {
RETVAL_FALSE;
@@ -690,14 +690,14 @@
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
-   ZVAL_STRINGL(out, (char *) output.bp, output.size, 1);
+   ZVAL_STRINGL(out, (char *) output.bp, output.size ? 
output.size-1 : 0, 1);
tidyBufFree(&output);
break;
 
case IS_UNICODE:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
tidySaveBuffer (obj->ptdoc->doc, &output);
-   ZVAL_U_STRINGL(obj->converter->conv, out, (char *) 
output.bp, output.size, 1);
+   ZVAL_U_STRINGL(obj->converter->conv, out, (char *) 
output.bp, output.size ? output.size-1 : 0, 1);
tidyBufFree(&output);
break;
 
@@ -765,9 +765,9 @@
if (output.size) {
MAKE_STD_ZVAL(temp);
if (UG(unicode)) {
-   ZVAL_U_STRINGL(obj->converter->conv, temp, (char *) 
output.bp, output.size, 1);
+   ZVAL_U_STRINGL(obj->converter->conv, temp, (char *) 
output.bp, output.size-1, 1);
} else {
-   ZVAL_STRINGL(temp, (char *) output.bp, output.size, 1);
+   ZVAL_STRINGL(temp, (char *) output.bp, output.size-1, 
1);
}
zend_ascii_hash_update(obj->std.properties, "value", 
sizeof("value"), (void *)&temp, sizeof(zval *), NULL);
}
@@ -1048,7 +1048,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.110 2007/01/20 12:58:20 nlopess Exp 
$)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.111 2007/01/23 19:50:14 nlopess Exp 
$)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1148,7 +1148,7 @@
tidySaveBuffer(doc, &outbuf);
FIX_BUFFER(&outbuf);
output_context->out.data = (char *) outbuf.bp;
-   output_context->out.used = outbuf.size - 1;
+   output_context->out.used = outbuf.size ? 
outbuf.size-1 : 0;
output_context->out.free = 1;
status = SUCCESS;
}
@@ -1224,7 +1224,7 @@
tidyBufInit(&output);
tidySaveBuffer(obj->ptdoc->doc, &output);
FIX_BUFFER(&output);
-   RETVAL_U_STRINGL(obj->converter->conv, (char *) output.bp, 
output.size-1, 1);
+   RETVAL_U_STRINGL(obj->converter->conv, (char *) output.bp, output.size 
? output.size-1 : 0, 1);
tidyBufFree(&output);
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/027.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/tidy/tests/027.phpt
diff -u /dev/null php-src/ext/tidy/tests/027.phpt:1.2
--- /dev/null   Tue Jan 23 19:50:14 2007
+++ php-src/ext/tidy/tests/027.phpt Tue Jan 23 19:50:14 2007
@@ -0,0 +1,59 @@
+--TEST--
+Bug: tidy segfaults with markup=false
+--SKIPIF--
+
+--FILE--
+http://sf.net/trac

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy/tests 027.phpt

2007-01-23 Thread Nuno Lopes
nlopess Tue Jan 23 19:26:24 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/tidy/tests 027.phpt 
  Log:
  add test
  

http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/027.phpt?view=markup&rev=1.1
Index: php-src/ext/tidy/tests/027.phpt
+++ php-src/ext/tidy/tests/027.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy tidy.c

2007-01-23 Thread Nuno Lopes
nlopess Tue Jan 23 19:23:29 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/tidy   tidy.c 
  Log:
  fix a few crashes
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.20&r2=1.66.2.8.2.21&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.20 
php-src/ext/tidy/tidy.c:1.66.2.8.2.21
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.20   Sat Jan 20 12:49:35 2007
+++ php-src/ext/tidy/tidy.c Tue Jan 23 19:23:29 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.20 2007/01/20 12:49:35 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.21 2007/01/23 19:23:29 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -515,7 +515,7 @@
tidyBufInit(&output);
 
tidySaveBuffer (doc, &output);
-   RETVAL_STRINGL(output.bp, output.size-1, 1);
+   RETVAL_STRINGL(output.bp, output.size ? 
output.size-1 : 0, 1);
tidyBufFree(&output);
} else {
RETVAL_FALSE;
@@ -683,7 +683,7 @@
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
-   ZVAL_STRINGL(out, output.bp, output.size-1, TRUE);
+   ZVAL_STRINGL(out, output.bp, output.size ? 
output.size-1 : 0, TRUE);
tidyBufFree(&output);
break;
 
@@ -990,7 +990,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.20 2007/01/20 12:49:35 
nlopess Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.21 2007/01/23 19:23:29 
nlopess Exp $)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1037,7 +1037,7 @@
tidyBufInit(&output);
 
tidySaveBuffer(doc, &output);
-   RETVAL_STRINGL(output.bp, output.size-1, 1);
+   RETVAL_STRINGL(output.bp, output.size ? output.size-1 : 
0, 1);
 
tidyBufFree(&output);
}
@@ -1103,7 +1103,7 @@
tidyBufInit(&output);
tidySaveBuffer(obj->ptdoc->doc, &output);
 
-   RETVAL_STRINGL(output.bp, output.size-1, 1);
+   RETVAL_STRINGL(output.bp, output.size ? output.size-1 : 0, 1);
 
tidyBufFree(&output);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c /ext/tidy/tests 024.phpt 025.phpt 026.phpt

2007-01-20 Thread Nuno Lopes
nlopess Sat Jan 20 12:58:20 2007 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
/php-src/ext/tidy/tests 024.phpt 025.phpt 026.phpt 
  Log:
  MFB: fix crash & add tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.109&r2=1.110&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.109 php-src/ext/tidy/tidy.c:1.110
--- php-src/ext/tidy/tidy.c:1.109   Sat Jan 20 12:27:55 2007
+++ php-src/ext/tidy/tidy.c Sat Jan 20 12:58:20 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.109 2007/01/20 12:27:55 nlopess Exp $ */
+/* $Id: tidy.c,v 1.110 2007/01/20 12:58:20 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -729,14 +729,22 @@
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
tidyBufInit(&buf);
-   tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
-   ZVAL_STRINGL(out, (char *) buf.bp, buf.size, 0);
+   if (obj->ptdoc) {
+   tidyNodeGetText(obj->ptdoc->doc, obj->node, 
&buf);
+   ZVAL_STRINGL(out, (char *) buf.bp, buf.size-1, 
0);
+   } else {
+   ZVAL_EMPTY_STRING(out);
+   }
break;
 
case IS_UNICODE:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
-   tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
-   ZVAL_U_STRINGL(obj->converter->conv, out, (char *) 
buf.bp, buf.size, 0);
+   if (obj->ptdoc) {
+   tidyNodeGetText(obj->ptdoc->doc, obj->node, 
&buf);
+   ZVAL_U_STRINGL(obj->converter->conv, out, (char 
*) buf.bp, buf.size-1, 0);
+   } else {
+   ZVAL_EMPTY_UNICODE(out);
+   }
break;
 
default:
@@ -1040,7 +1048,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.109 2007/01/20 12:27:55 nlopess Exp 
$)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.110 2007/01/20 12:58:20 nlopess Exp 
$)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/024.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/tidy/tests/024.phpt
diff -u /dev/null php-src/ext/tidy/tests/024.phpt:1.2
--- /dev/null   Sat Jan 20 12:58:20 2007
+++ php-src/ext/tidy/tests/024.phpt Sat Jan 20 12:58:20 2007
@@ -0,0 +1,41 @@
+--TEST--
+libtidy handling of 'new-blocklevel-tags'
+--SKIPIF--
+
+--FILE--
+http://sf.net/tracker/?func=detail&atid=390963&aid=1598422&group_id=27659
+
+$contents = '
+
+
+
+
+';
+
+$config = array(
+'new-blocklevel-tags' => 'wps:block,wps:var,wps:value'
+);
+
+$tidy = tidy_parse_string($contents, $config, 'utf8');
+$tidy->cleanRepair();
+
+var_dump($tidy->value);
+
+?>
+--EXPECT--
+string(117) "
+
+
+
+
+
+
+
+
+
+"
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/025.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/tidy/tests/025.phpt
diff -u /dev/null php-src/ext/tidy/tests/025.phpt:1.2
--- /dev/null   Sat Jan 20 12:58:20 2007
+++ php-src/ext/tidy/tests/025.phpt Sat Jan 20 12:58:20 2007
@@ -0,0 +1,50 @@
+--TEST--
+tidyNode tests
+--SKIPIF--
+
+--FILE--
+isPhp());
+var_dump($node->isText());
+var_dump($node->isComment());
+var_dump($node->hasSiblings());
+var_dump((string)$node);
+
+$tidy=tidy_parse_string('<% %>');
+var_dump($tidy->Root()->child[0]->isAsp());
+
+$tidy=tidy_parse_string('<# #>');
+var_dump($tidy->Root()->child[0]->isJste());
+
+$tidy=tidy_parse_string('text');
+var_dump($tidy->Root()->child[0]->child[1]->child[0]->isText());
+
+$tidy=tidy_parse_string('');
+$n = $tidy->Root()->child[0]->child[1]->child[0];
+var_dump($n->isComment());
+var_dump((string)$n);
+var_dump((bool)$n);
+var_dump((double)$n);
+var_dump((int)$n);
+var_dump($tidy->Root()->child[0]->child[0]->hasSiblings());
+
+?>
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(0) ""
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+string(16) ""
+bool(true)
+float(0)
+int(0)
+bool(true)
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/026.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/tidy/tests/026.phpt
diff -u /dev/null php-src/ext/tidy/tests/026.phpt:1.2
--- /dev/null   Sat Jan 20 12:58:20 2007
+++ php-src/ext/tidy/tests/026.phpt Sat Jan 20 12:58:20 2007
@@ -0,0 +1,24 @@
+--TEST--
+tidy.cl

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy/tests 024.phpt 025.phpt 026.phpt

2007-01-20 Thread Nuno Lopes
nlopess Sat Jan 20 12:50:19 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/tidy/tests 024.phpt 025.phpt 026.phpt 
  Log:
  new tests. bump code coverage to 81%
  

http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/024.phpt?view=markup&rev=1.1
Index: php-src/ext/tidy/tests/024.phpt
+++ php-src/ext/tidy/tests/024.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/025.phpt?view=markup&rev=1.1
Index: php-src/ext/tidy/tests/025.phpt
+++ php-src/ext/tidy/tests/025.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tests/026.phpt?view=markup&rev=1.1
Index: php-src/ext/tidy/tests/026.phpt
+++ php-src/ext/tidy/tests/026.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy tidy.c

2007-01-20 Thread Nuno Lopes
nlopess Sat Jan 20 12:49:35 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/tidy   tidy.c 
  Log:
  fix another crash
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.19&r2=1.66.2.8.2.20&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.19 
php-src/ext/tidy/tidy.c:1.66.2.8.2.20
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.19   Sat Jan 20 12:27:18 2007
+++ php-src/ext/tidy/tidy.c Sat Jan 20 12:49:35 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.19 2007/01/20 12:27:18 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.20 2007/01/20 12:49:35 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -715,8 +715,10 @@
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
tidyBufInit(&buf);
-   tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
-   ZVAL_STRINGL(out, buf.bp, buf.size-1, TRUE);
+   if (obj->ptdoc) {
+   tidyNodeGetText(obj->ptdoc->doc, obj->node, 
&buf);
+   }
+   ZVAL_STRINGL(out, buf.bp, buf.size ? buf.size-1 : 0, 
TRUE);
tidyBufFree(&buf);
break;
 
@@ -988,7 +990,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.19 2007/01/20 12:27:18 
nlopess Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.20 2007/01/20 12:49:35 
nlopess Exp $)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c

2007-01-20 Thread Nuno Lopes
nlopess Sat Jan 20 12:27:55 2007 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
  Log:
  MFB: fix crash
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.108&r2=1.109&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.108 php-src/ext/tidy/tidy.c:1.109
--- php-src/ext/tidy/tidy.c:1.108   Fri Jan 19 18:57:06 2007
+++ php-src/ext/tidy/tidy.c Sat Jan 20 12:27:55 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.108 2007/01/19 18:57:06 nlopess Exp $ */
+/* $Id: tidy.c,v 1.109 2007/01/20 12:27:55 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1040,7 +1040,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.108 2007/01/19 18:57:06 nlopess Exp 
$)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.109 2007/01/20 12:27:55 nlopess Exp 
$)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1712,7 +1712,7 @@
 {
TIDY_FETCH_ONLY_OBJECT;
 
-   if (tidyGetNext(obj->node)) {
+   if (obj->node && tidyGetNext(obj->node)) {
RETURN_TRUE;
} else {
RETURN_FALSE;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy tidy.c

2007-01-20 Thread Nuno Lopes
nlopess Sat Jan 20 12:27:18 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/tidy   tidy.c 
  Log:
  fix crash. tests will follow
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.18&r2=1.66.2.8.2.19&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.18 
php-src/ext/tidy/tidy.c:1.66.2.8.2.19
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.18   Fri Jan 19 18:50:26 2007
+++ php-src/ext/tidy/tidy.c Sat Jan 20 12:27:18 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.18 2007/01/19 18:50:26 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.19 2007/01/20 12:27:18 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -988,7 +988,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.18 2007/01/19 18:50:26 
nlopess Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.19 2007/01/20 12:27:18 
nlopess Exp $)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1565,7 +1565,7 @@
 {
TIDY_FETCH_ONLY_OBJECT;
 
-   if (tidyGetNext(obj->node)) {
+   if (obj->node && tidyGetNext(obj->node)) {
RETURN_TRUE;
} else {
RETURN_FALSE;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/tidy tidy.c

2007-01-19 Thread Nuno Lopes
nlopess Fri Jan 19 18:57:06 2007 UTC

  Modified files:  
/php-src/ext/tidy   tidy.c 
  Log:
  MFB: fix segfaults with new libtidy
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.107&r2=1.108&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.107 php-src/ext/tidy/tidy.c:1.108
--- php-src/ext/tidy/tidy.c:1.107   Mon Jan  1 09:29:33 2007
+++ php-src/ext/tidy/tidy.c Fri Jan 19 18:57:06 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.107 2007/01/01 09:29:33 sebastian Exp $ */
+/* $Id: tidy.c,v 1.108 2007/01/19 18:57:06 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -511,8 +511,8 @@
}

if (data) {
-   TidyBuffer buf = {0};
-   
+   TidyBuffer buf;
+
tidyBufInit(&buf);
tidyBufAttach(&buf, (byte *) data, data_len);

@@ -521,7 +521,8 @@
RETVAL_FALSE;
} else {
if (tidyCleanAndRepair(doc) >= 0) {
-   TidyBuffer output = {0};
+   TidyBuffer output;
+   tidyBufInit(&output);
 
tidySaveBuffer (doc, &output);
FIX_BUFFER(&output);
@@ -669,7 +670,7 @@
 
 static int tidy_doc_cast_handler(zval *in, zval *out, int type, void *extra 
TSRMLS_DC)
 {
-   TidyBuffer output = {0};
+   TidyBuffer output;
PHPTidyObj *obj;
 
switch(type) {
@@ -687,6 +688,7 @@
 
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
+   tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
ZVAL_STRINGL(out, (char *) output.bp, output.size, 1);
tidyBufFree(&output);
@@ -708,7 +710,7 @@
 
 static int tidy_node_cast_handler(zval *in, zval *out, int type, void *extra 
TSRMLS_DC)
 {
-   TidyBuffer buf = {0};
+   TidyBuffer buf;
PHPTidyObj *obj;
 
switch(type) {
@@ -726,6 +728,7 @@
 
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
+   tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
ZVAL_STRINGL(out, (char *) buf.bp, buf.size, 0);
break;
@@ -745,9 +748,10 @@
 
 static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
 {
-   TidyBuffer output = {0};
+   TidyBuffer output;
zval *temp;
 
+   tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
 
if (output.size) {
@@ -781,8 +785,7 @@
switch(type) {
 
case is_node:
-
-   memset(&buf, 0, sizeof(buf));
+   tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
ADD_PROPERTY_STRINGL(obj->converter->conv, 
obj->std.properties, value, buf.bp, buf.size-1);
tidyBufFree(&buf);
@@ -854,9 +857,6 @@
ADD_PROPERTY_NULL(obj->std.properties, errorBuffer);
ADD_PROPERTY_NULL(obj->std.properties, value);
break;
-
-   default:
-   break;
}
 }
 
@@ -965,7 +965,7 @@
 
 static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char 
*enc TSRMLS_DC)
 {
-   TidyBuffer buf = {0};
+   TidyBuffer buf;
UErrorCode Uerror = U_ZERO_ERROR;
 
if(enc) {
@@ -1040,7 +1040,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.107 2007/01/01 09:29:33 sebastian 
Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.108 2007/01/19 18:57:06 nlopess Exp 
$)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -1119,7 +1119,7 @@
 {
int status = FAILURE;
TidyDoc doc;
-   TidyBuffer inbuf = {0}, outbuf = {0}, errbuf = {0};
+   TidyBuffer inbuf, outbuf, errbuf;
PHP_OUTPUT_TSRMLS(output_context);

if (TG(clean_output) && (output_context->op & PHP_OUTPUT_HANDLER_START) 
&& (output_context->op & PHP_OUTPUT_HANDLER_FINAL)) {
@@ -1210,9 +1210,10 @@
Return a string representing the parsed tidy markup */
 static PHP_FUNCTION(tidy_get_output)
 {
-   TidyBuffer output = {0};
+   TidyBuffer output;
TIDY_FETCH_OBJECT;
 
+   tidyBufInit(&output);
tid

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/tidy tidy.c

2007-01-19 Thread Nuno Lopes
nlopess Fri Jan 19 18:50:26 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/tidy   tidy.c 
  Log:
  fix segfaults with new libtidy. the patch is backwards compatible
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.17&r2=1.66.2.8.2.18&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.17 
php-src/ext/tidy/tidy.c:1.66.2.8.2.18
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.17   Mon Jan  1 09:36:09 2007
+++ php-src/ext/tidy/tidy.c Fri Jan 19 18:50:26 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.17 2007/01/01 09:36:09 sebastian Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.18 2007/01/19 18:50:26 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -501,17 +501,18 @@
}

if (data) {
-   TidyBuffer buf = {0};
-   
+   TidyBuffer buf;
+
tidyBufInit(&buf);
tidyBufAppend(&buf, data, data_len);
-   
+
if (tidyParseBuffer(doc, &buf) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", 
errbuf->bp);
RETVAL_FALSE;
} else {
if (tidyCleanAndRepair(doc) >= 0) {
-   TidyBuffer output = {0};
+   TidyBuffer output;
+   tidyBufInit(&output);
 
tidySaveBuffer (doc, &output);
RETVAL_STRINGL(output.bp, output.size-1, 1);
@@ -662,7 +663,7 @@
 
 static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
 {
-   TidyBuffer output = {0};
+   TidyBuffer output;
PHPTidyObj *obj;
 
switch(type) {
@@ -680,6 +681,7 @@
 
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
+   tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);
ZVAL_STRINGL(out, output.bp, output.size-1, TRUE);
tidyBufFree(&output);
@@ -694,7 +696,7 @@
 
 static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
 {
-   TidyBuffer buf = {0};
+   TidyBuffer buf;
PHPTidyObj *obj;
 
switch(type) {
@@ -712,6 +714,7 @@
 
case IS_STRING:
obj = (PHPTidyObj *)zend_object_store_get_object(in 
TSRMLS_CC);
+   tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
ZVAL_STRINGL(out, buf.bp, buf.size-1, TRUE);
tidyBufFree(&buf);
@@ -727,9 +730,10 @@
 static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
 {
 
-   TidyBuffer output = {0};
+   TidyBuffer output;
zval *temp;
 
+   tidyBufInit(&output);
tidySaveBuffer (obj->ptdoc->doc, &output);

if (output.size) {
@@ -759,8 +763,7 @@
switch(type) {
 
case is_node:
-
-   memset(&buf, 0, sizeof(buf));
+   tidyBufInit(&buf);
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
ADD_PROPERTY_STRINGL(obj->std.properties, value, 
buf.bp, buf.size-1);
tidyBufFree(&buf);
@@ -832,9 +835,6 @@
ADD_PROPERTY_NULL(obj->std.properties, errorBuffer);
ADD_PROPERTY_NULL(obj->std.properties, value);
break;
-
-   default:
-   break;
}
 }
 
@@ -925,7 +925,7 @@
 
 static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char 
*enc TSRMLS_DC)
 {
-   TidyBuffer buf = {0};
+   TidyBuffer buf;

if(enc) {
if (tidySetCharEncoding(obj->ptdoc->doc, enc) < 0) {
@@ -988,7 +988,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.17 2007/01/01 09:36:09 
sebastian Exp $)");
+   php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.18 2007/01/19 18:50:26 
nlopess Exp $)");
php_info_print_table_end();
 
DISPLAY_INI_ENTRIES();
@@ -999,7 +999,7 @@
char *input;
int input_len;
long mode;
-   TidyBuffer errbuf = {0};
+   TidyBuffer errbuf;
TidyDoc doc;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &input, 
&input_len, &mode) == FAILURE) {
@@ -1022,7 +1022,7 @@
TIDY_SET_DEFAULT_CONFIG(doc);
 
if (input_len > 1)

[PHP-CVS] cvs: php-src /main/streams php_stream_transport.h

2007-01-18 Thread Nuno Lopes
nlopess Thu Jan 18 16:06:29 2007 UTC

  Modified files:  
/php-src/main/streams   php_stream_transport.h 
  Log:
  MFB: use only 2 bits
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/php_stream_transport.h?r1=1.13&r2=1.14&diff_format=u
Index: php-src/main/streams/php_stream_transport.h
diff -u php-src/main/streams/php_stream_transport.h:1.13 
php-src/main/streams/php_stream_transport.h:1.14
--- php-src/main/streams/php_stream_transport.h:1.13Mon Jan  1 09:29:35 2007
+++ php-src/main/streams/php_stream_transport.h Thu Jan 18 16:06:28 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_stream_transport.h,v 1.13 2007/01/01 09:29:35 sebastian Exp $ */
+/* $Id: php_stream_transport.h,v 1.14 2007/01/18 16:06:28 nlopess Exp $ */
 
 #if HAVE_SYS_SOCKET_H
 # include 
@@ -133,7 +133,7 @@
unsigned int want_addr:1;
unsigned int want_textaddr:1;
unsigned int want_errortext:1;
-   stream_shutdown_t how:3;
+   stream_shutdown_t how:2;
 
struct {
char *name;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams php_stream_transport.h

2007-01-18 Thread Nuno Lopes
nlopess Thu Jan 18 16:05:48 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   php_stream_transport.h 
  Log:
  only 2 bits are needed for shutdown(2) method (only 3 possible values). this 
is new code in 5.2.1, so don't worry..
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/php_stream_transport.h?r1=1.10.2.1.2.2&r2=1.10.2.1.2.3&diff_format=u
Index: php-src/main/streams/php_stream_transport.h
diff -u php-src/main/streams/php_stream_transport.h:1.10.2.1.2.2 
php-src/main/streams/php_stream_transport.h:1.10.2.1.2.3
--- php-src/main/streams/php_stream_transport.h:1.10.2.1.2.2Mon Jan  1 
09:36:12 2007
+++ php-src/main/streams/php_stream_transport.h Thu Jan 18 16:05:48 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_stream_transport.h,v 1.10.2.1.2.2 2007/01/01 09:36:12 sebastian 
Exp $ */
+/* $Id: php_stream_transport.h,v 1.10.2.1.2.3 2007/01/18 16:05:48 nlopess Exp 
$ */
 
 #if HAVE_SYS_SOCKET_H
 # include 
@@ -133,7 +133,7 @@
unsigned int want_addr:1;
unsigned int want_textaddr:1;
unsigned int want_errortext:1;
-   stream_shutdown_t how:3;
+   stream_shutdown_t how:2;
 
struct {
char *name;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-01-14 Thread Nuno Lopes
As the commit log says, I fixed a few valgrind warnings in the 
bug24594.phpt

test (it was reading one past the end of the array). The log is still
available at
http://gcov.php.net/viewer.php?version=PHP_5_2&func=valgrind&file=ext%2Fgd%2Ftests%2Fbug24594.phpt
the fix is this part:
- for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
+ for (; x

What is the OS/compiler/cpu on this box? I remember that there was
warnings/errors there but nobody else was able to reproduce. Can you
reproduce this warning on your local box?


It is reproducible everywhere, I must say (including my pc). wx2 is the size 
of the array, so you can only read from idx 0 to (wx2-1). Reading idx wx2 
doesn't make sense.
For statistics, the gcov machine has Debian stable (gcc 3.3) and a Celeron 
cpu.




It is really dead code and it was even marked as such. It is impossible
(excluding compiler/cpu/memory/.. bugs) to reach the code I removed.
If you feel scary with such trivial changes that means the extension 
hasn't

enough tests :P (ok, kidding. that part of the code is covered)


I did not say that this code is used or reached. I said that I liked
to keep it. I do feel good with this function (I will not rewrite the
old one and put my result in a stable branche if I was not), that's
not the question. I only liked to keep it or at the very least to put
it in a comment. It helps to quickly get the whole picture when you
read the function after a long time :)


uhm the code was something like this:
 for (...; A && !B && C; ..) {
  if (B) {
   break;
  }

How is B true there if it must be false to enter in the 'for' loop? It 
can't. Anyway you are the extension maintainer, so feel free to revert the 
patch and/or not merge it to libgd.




The code can still be further optimized when using square images, but I
didn't deliberately make such change in an RC phase and without your
approval.


I like to first see a patch for this optimization. There is many
special cases or things to worry about here and BC is important. I'm
not saying that an optimization is not possible or welcome, only that
I like to see it prior to commit.


Sure. I said I wasn't going to make it for now (before php 5.2.1 is 
released). After that I can look at it (and no, it won't have any BC 
issues).

You'll be the first to read it, don't worry ;)


Nuno 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-01-13 Thread Nuno Lopes

On 1/13/07, Nuno Lopes <[EMAIL PROTECTED]> wrote:

nlopess Sat Jan 13 11:16:15 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd.c
  Log:
  fix valgrind error in test bug24594.phpt
  while at it, remove some dead code and change the pts vector to char to 
save (much) memory

  # Pierre: one more to merge ;)


Thanks for the catch. I like to merge (and keep the fix) if I know
what you are fixing. Can you send me the details please?


As the commit log says, I fixed a few valgrind warnings in the bug24594.phpt 
test (it was reading one past the end of the array). The log is still 
available at 
http://gcov.php.net/viewer.php?version=PHP_5_2&func=valgrind&file=ext%2Fgd%2Ftests%2Fbug24594.phpt

the fix is this part:
- for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
+ for (; x
About removing the dead code, again I do not like to do it during the
RC phase. Please do it __after__ 5.2.1 (take #2) if there is a very
good reason to do it, but I like to keep it (as I voluntary kept it).


It is really dead code and it was even marked as such. It is impossible 
(excluding compiler/cpu/memory/.. bugs) to reach the code I removed.
If you feel scary with such trivial changes that means the extension hasn't 
enough tests :P (ok, kidding. that part of the code is covered)



  OMG, this line was really bogus (and allocating huge amounts of memory 
unnecessarily)


It was more wrong after your change (int -> char) but as I said I did
not see good reasons to change that now. Or is it critical and if yes
how?


it is critical to my point of view :) Before my patch it would take 4 times 
more memory than after the patch. With larger images, it is critical :P
The code can still be further optimized when using square images, but I 
didn't deliberately make such change in an RC phase and without your 
approval.



Nuno 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gd.c

2007-01-13 Thread Nuno Lopes
nlopess Sat Jan 13 11:22:44 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd.c 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.100&r2=1.101&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.100 php-src/ext/gd/libgd/gd.c:1.101
--- php-src/ext/gd/libgd/gd.c:1.100 Sat Jan 13 11:16:53 2007
+++ php-src/ext/gd/libgd/gd.c   Sat Jan 13 11:22:44 2007
@@ -2014,7 +2014,7 @@
tiled = nc==gdTiled;
 
nc =  gdImageTileGet(im,x,y);
-   pts = (char **) ecalloc(sizeof(char *) * im->sy, sizeof(char));
+   pts = (char **) ecalloc(im->sy, sizeof(char*));
 
for (i=0; isy;i++) {
pts[i] = (char *) ecalloc(im->sx, sizeof(char));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-01-13 Thread Nuno Lopes
nlopess Sat Jan 13 11:21:21 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd.c 
  Log:
  OMG, this line was really bogus (and allocating huge amounts of memory 
unecessarly)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.7&r2=1.90.2.1.2.8&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.7 
php-src/ext/gd/libgd/gd.c:1.90.2.1.2.8
--- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.7  Sat Jan 13 11:16:15 2007
+++ php-src/ext/gd/libgd/gd.c   Sat Jan 13 11:21:21 2007
@@ -2014,7 +2014,7 @@
tiled = nc==gdTiled;
 
nc =  gdImageTileGet(im,x,y);
-   pts = (char **) ecalloc(sizeof(char *) * im->sy, sizeof(char));
+   pts = (char **) ecalloc(im->sy, sizeof(char*));
 
for (i=0; isy;i++) {
pts[i] = (char *) ecalloc(im->sx, sizeof(char));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd/libgd gd.c

2007-01-13 Thread Nuno Lopes
nlopess Sat Jan 13 11:16:54 2007 UTC

  Modified files:  
/php-src/ext/gd/libgd   gd.c 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.99&r2=1.100&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.99 php-src/ext/gd/libgd/gd.c:1.100
--- php-src/ext/gd/libgd/gd.c:1.99  Sun Dec 10 02:08:07 2006
+++ php-src/ext/gd/libgd/gd.c   Sat Jan 13 11:16:53 2007
@@ -2004,9 +2004,9 @@
/* stack of filled segments */
struct seg *stack;
struct seg *sp;
+   char **pts;
 
-   int **pts;
-   if(!im->tile){
+   if (!im->tile) {
return;
}
 
@@ -2014,10 +2014,10 @@
tiled = nc==gdTiled;
 
nc =  gdImageTileGet(im,x,y);
-   pts = (int **) ecalloc(sizeof(int *) * im->sy, sizeof(int));
+   pts = (char **) ecalloc(sizeof(char *) * im->sy, sizeof(char));
 
for (i=0; isy;i++) {
-   pts[i] = (int *) ecalloc(im->sx, sizeof(int));
+   pts[i] = (char *) ecalloc(im->sx, sizeof(char));
}
 
stack = (struct seg *)safe_emalloc(sizeof(struct seg), 
((int)(im->sy*im->sx)/4), 1);
@@ -2032,10 +2032,6 @@
while (sp>stack) {
FILL_POP(y, x1, x2, dy);
for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); 
x--) {
-   if (pts[y][x]){
-   /* we should never be here */
-   break;
-   }
nc = gdImageTileGet(im,x,y);
pts[y][x]=1;
gdImageSetPixel(im,x, y, nc);
@@ -2051,11 +2047,7 @@
}
x = x1+1;
do {
-   for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, 
y)==oc) ; x++) {
-   if (pts[y][x]){
-   /* we should never be here */
-   break;
-   }
+   for (; xhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd/libgd gd.c

2007-01-13 Thread Nuno Lopes
nlopess Sat Jan 13 11:16:15 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd/libgd   gd.c 
  Log:
  fix valgrind error in test bug24594.phpt
  while at it, remove some dead code and change the pts vector to char to save 
(much) memory
  # Pierre: one more to merge ;)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.6&r2=1.90.2.1.2.7&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.6 
php-src/ext/gd/libgd/gd.c:1.90.2.1.2.7
--- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.6  Tue Nov 14 13:45:24 2006
+++ php-src/ext/gd/libgd/gd.c   Sat Jan 13 11:16:15 2007
@@ -2004,9 +2004,9 @@
/* stack of filled segments */
struct seg *stack;
struct seg *sp;
+   char **pts;
 
-   int **pts;
-   if(!im->tile){
+   if (!im->tile) {
return;
}
 
@@ -2014,10 +2014,10 @@
tiled = nc==gdTiled;
 
nc =  gdImageTileGet(im,x,y);
-   pts = (int **) ecalloc(sizeof(int *) * im->sy, sizeof(int));
+   pts = (char **) ecalloc(sizeof(char *) * im->sy, sizeof(char));
 
for (i=0; isy;i++) {
-   pts[i] = (int *) ecalloc(im->sx, sizeof(int));
+   pts[i] = (char *) ecalloc(im->sx, sizeof(char));
}
 
stack = (struct seg *)safe_emalloc(sizeof(struct seg), 
((int)(im->sy*im->sx)/4), 1);
@@ -2032,10 +2032,6 @@
while (sp>stack) {
FILL_POP(y, x1, x2, dy);
for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); 
x--) {
-   if (pts[y][x]){
-   /* we should never be here */
-   break;
-   }
nc = gdImageTileGet(im,x,y);
pts[y][x]=1;
gdImageSetPixel(im,x, y, nc);
@@ -2051,11 +2047,7 @@
}
x = x1+1;
do {
-   for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, 
y)==oc) ; x++) {
-   if (pts[y][x]){
-   /* we should never be here */
-   break;
-   }
+   for (; xhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/session session.c

2007-01-09 Thread Nuno Lopes

I think this one needs a test..


- Original Message - 
From: "Ilia Alshanetsky" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, January 09, 2007 3:31 PM
Subject: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/session session.c



iliaa Tue Jan  9 15:31:12 2007 UTC

 Modified files:  (Branch: PHP_5_2)
   /php-src/ext/session session.c
 Log:

 Prevent SESSION/GLOBALS overload via session decoding


http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.417.2.8.2.24&r2=1.417.2.8.2.25&diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.417.2.8.2.24 
php-src/ext/session/session.c:1.417.2.8.2.25

--- php-src/ext/session/session.c:1.417.2.8.2.24 Mon Jan  1 09:36:06 2007
+++ php-src/ext/session/session.c Tue Jan  9 15:31:12 2007
@@ -17,7 +17,7 @@

+--+
 */

-/* $Id: session.c,v 1.417.2.8.2.24 2007/01/01 09:36:06 sebastian Exp $ */
+/* $Id: session.c,v 1.417.2.8.2.25 2007/01/09 15:31:12 iliaa Exp $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -331,6 +331,10 @@
 zend_hash_find(&EG(symbol_table), name, namelen + 1,
 (void *) &sym_global);

+ if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == 
&EG(symbol_table)) || *sym_global == PS(http_session_vars)) {

+ return;
+ }
+
 if (sym_global == NULL && sym_track == NULL) {
 zval *empty_var;

@@ -360,7 +364,10 @@
 if (PG(register_globals)) {
 zval **old_symbol;
 if (zend_hash_find(&EG(symbol_table),name,namelen+1,(void *)&old_symbol) 
== SUCCESS) {

-
+ if ((Z_TYPE_PP(old_symbol) == IS_ARRAY && Z_ARRVAL_PP(old_symbol) == 
&EG(symbol_table)) || *old_symbol == PS(http_session_vars)) {

+ return;
+ }
+
 /*
 * A global symbol with the same name exists already. That
 * symbol might have been created by other means (e.g. $_GET).

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd gd.c php_gd.h

2007-01-09 Thread Nuno Lopes

On Mon, 8 Jan 2007, Nuno Lopes wrote:


nlopess Mon Jan  8 22:52:23 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd gd.c php_gd.h
  Log:
  avoid calling MSHUTDOWN when built without libt1


Is it really needed to clog the source code with those ifdefs? It's not
like this is a performance issue here...


I don't think this is "clogging" the code. I also think that any "free" 
speedup is welcome (even minor). Anyway this part of the code is rarely 
changed, so it shouldn't be any nightmare to maintain. (the ifdef was 
already there. I just moved it around)


Nuno 


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/gd gd.c php_gd.h

2007-01-08 Thread Nuno Lopes
nlopess Mon Jan  8 22:56:26 2007 UTC

  Modified files:  
/php-src/ext/gd gd.c php_gd.h 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.364&r2=1.365&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.364 php-src/ext/gd/gd.c:1.365
--- php-src/ext/gd/gd.c:1.364   Mon Jan  1 09:29:24 2007
+++ php-src/ext/gd/gd.c Mon Jan  8 22:56:25 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.364 2007/01/01 09:29:24 sebastian Exp $ */
+/* $Id: gd.c,v 1.365 2007/01/08 22:56:25 nlopess Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1078,7 +1078,11 @@
"gd",
gd_functions,
PHP_MINIT(gd),
+#if HAVE_LIBT1
PHP_MSHUTDOWN(gd),
+#else
+   NULL,
+#endif
NULL,
 #if HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE)
PHP_RSHUTDOWN(gd),
@@ -1122,16 +1126,16 @@
 }
 /* }}} */
 
+#if HAVE_LIBT1
 /* {{{ PHP_MSHUTDOWN_FUNCTION
  */
 PHP_MSHUTDOWN_FUNCTION(gd)
 {
-#if HAVE_LIBT1
T1_CloseLib();
-#endif
return SUCCESS;
 }
 /* }}} */
+#endif
 
 
 /* {{{ PHP_MINIT_FUNCTION
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/php_gd.h?r1=1.71&r2=1.72&diff_format=u
Index: php-src/ext/gd/php_gd.h
diff -u php-src/ext/gd/php_gd.h:1.71 php-src/ext/gd/php_gd.h:1.72
--- php-src/ext/gd/php_gd.h:1.71Mon Jan  1 09:29:24 2007
+++ php-src/ext/gd/php_gd.h Mon Jan  8 22:56:26 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_gd.h,v 1.71 2007/01/01 09:29:24 sebastian Exp $ */
+/* $Id: php_gd.h,v 1.72 2007/01/08 22:56:26 nlopess Exp $ */
 
 #ifndef PHP_GD_H
 #define PHP_GD_H
@@ -64,7 +64,9 @@
 /* gd.c functions */
 PHP_MINFO_FUNCTION(gd);
 PHP_MINIT_FUNCTION(gd);
+#if HAVE_LIBT1
 PHP_MSHUTDOWN_FUNCTION(gd);
+#endif
 #if HAVE_GD_STRINGFT
 PHP_RSHUTDOWN_FUNCTION(gd);
 #endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd gd.c php_gd.h

2007-01-08 Thread Nuno Lopes
nlopess Mon Jan  8 22:52:23 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd gd.c php_gd.h 
  Log:
  avoid calling MSHUTDOWN when built without libt1
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.13&r2=1.312.2.20.2.14&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.20.2.13 php-src/ext/gd/gd.c:1.312.2.20.2.14
--- php-src/ext/gd/gd.c:1.312.2.20.2.13 Fri Jan  5 15:06:55 2007
+++ php-src/ext/gd/gd.c Mon Jan  8 22:52:22 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.312.2.20.2.13 2007/01/05 15:06:55 iliaa Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.14 2007/01/08 22:52:22 nlopess Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1147,7 +1147,11 @@
"gd",
gd_functions,
PHP_MINIT(gd),
+#if HAVE_LIBT1
PHP_MSHUTDOWN(gd),
+#else
+   NULL,
+#endif
NULL,
 #if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || 
HAVE_GD_FREEFONTCACHE)
PHP_RSHUTDOWN(gd),
@@ -1191,16 +1195,16 @@
 }
 /* }}} */
 
+#if HAVE_LIBT1
 /* {{{ PHP_MSHUTDOWN_FUNCTION
  */
 PHP_MSHUTDOWN_FUNCTION(gd)
 {
-#if HAVE_LIBT1
T1_CloseLib();
-#endif
return SUCCESS;
 }
 /* }}} */
+#endif
 
 
 /* {{{ PHP_MINIT_FUNCTION
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/php_gd.h?r1=1.59.2.3.2.1&r2=1.59.2.3.2.2&diff_format=u
Index: php-src/ext/gd/php_gd.h
diff -u php-src/ext/gd/php_gd.h:1.59.2.3.2.1 
php-src/ext/gd/php_gd.h:1.59.2.3.2.2
--- php-src/ext/gd/php_gd.h:1.59.2.3.2.1Mon Jan  1 09:36:01 2007
+++ php-src/ext/gd/php_gd.h Mon Jan  8 22:52:22 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_gd.h,v 1.59.2.3.2.1 2007/01/01 09:36:01 sebastian Exp $ */
+/* $Id: php_gd.h,v 1.59.2.3.2.2 2007/01/08 22:52:22 nlopess Exp $ */
 
 #ifndef PHP_GD_H
 #define PHP_GD_H
@@ -66,7 +66,9 @@
 /* gd.c functions */
 PHP_MINFO_FUNCTION(gd);
 PHP_MINIT_FUNCTION(gd);
+#if HAVE_LIBT1
 PHP_MSHUTDOWN_FUNCTION(gd);
+#endif
 #if HAVE_LIBGD20 && HAVE_GD_STRINGFT
 PHP_RSHUTDOWN_FUNCTION(gd);
 #endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/sysvmsg php_sysvmsg.h sysvmsg.c

2007-01-08 Thread Nuno Lopes
nlopess Mon Jan  8 22:35:25 2007 UTC

  Modified files:  
/php-src/ext/sysvmsgphp_sysvmsg.h sysvmsg.c 
  Log:
  MFB: remove mshutdown func
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sysvmsg/php_sysvmsg.h?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/sysvmsg/php_sysvmsg.h
diff -u php-src/ext/sysvmsg/php_sysvmsg.h:1.8 
php-src/ext/sysvmsg/php_sysvmsg.h:1.9
--- php-src/ext/sysvmsg/php_sysvmsg.h:1.8   Mon Jan  1 09:29:33 2007
+++ php-src/ext/sysvmsg/php_sysvmsg.h   Mon Jan  8 22:35:25 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_sysvmsg.h,v 1.8 2007/01/01 09:29:33 sebastian Exp $ */
+/* $Id: php_sysvmsg.h,v 1.9 2007/01/08 22:35:25 nlopess Exp $ */
 
 #ifndef PHP_SYSVMSG_H
 #define PHP_SYSVMSG_H
@@ -40,9 +40,6 @@
 #endif
 
 PHP_MINIT_FUNCTION(sysvmsg);
-PHP_MSHUTDOWN_FUNCTION(sysvmsg);
-PHP_RINIT_FUNCTION(sysvmsg);
-PHP_RSHUTDOWN_FUNCTION(sysvmsg);
 PHP_MINFO_FUNCTION(sysvmsg);
 
 PHP_FUNCTION(msg_get_queue);
http://cvs.php.net/viewvc.cgi/php-src/ext/sysvmsg/sysvmsg.c?r1=1.29&r2=1.30&diff_format=u
Index: php-src/ext/sysvmsg/sysvmsg.c
diff -u php-src/ext/sysvmsg/sysvmsg.c:1.29 php-src/ext/sysvmsg/sysvmsg.c:1.30
--- php-src/ext/sysvmsg/sysvmsg.c:1.29  Mon Jan  1 09:29:33 2007
+++ php-src/ext/sysvmsg/sysvmsg.c   Mon Jan  8 22:35:25 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: sysvmsg.c,v 1.29 2007/01/01 09:29:33 sebastian Exp $ */
+/* $Id: sysvmsg.c,v 1.30 2007/01/08 22:35:25 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -84,7 +84,7 @@
"sysvmsg",
sysvmsg_functions,
PHP_MINIT(sysvmsg),
-   PHP_MSHUTDOWN(sysvmsg),
+   NULL,
NULL,
NULL,
PHP_MINFO(sysvmsg),
@@ -130,21 +130,13 @@
 }
 /* }}} */
 
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(sysvmsg)
-{
-   return SUCCESS;
-}
-/* }}} */
-
 /* {{{ PHP_MINFO_FUNCTION
  */
 PHP_MINFO_FUNCTION(sysvmsg)
 {
php_info_print_table_start();
php_info_print_table_row(2, "sysvmsg support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.29 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.30 $");
php_info_print_table_end();
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sysvmsg php_sysvmsg.h sysvmsg.c

2007-01-08 Thread Nuno Lopes
nlopess Mon Jan  8 22:34:07 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/sysvmsgphp_sysvmsg.h sysvmsg.c 
  Log:
  remove useless MSHUTDOWN function
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sysvmsg/php_sysvmsg.h?r1=1.6.2.1.2.1&r2=1.6.2.1.2.2&diff_format=u
Index: php-src/ext/sysvmsg/php_sysvmsg.h
diff -u php-src/ext/sysvmsg/php_sysvmsg.h:1.6.2.1.2.1 
php-src/ext/sysvmsg/php_sysvmsg.h:1.6.2.1.2.2
--- php-src/ext/sysvmsg/php_sysvmsg.h:1.6.2.1.2.1   Mon Jan  1 09:36:09 2007
+++ php-src/ext/sysvmsg/php_sysvmsg.h   Mon Jan  8 22:34:07 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_sysvmsg.h,v 1.6.2.1.2.1 2007/01/01 09:36:09 sebastian Exp $ */
+/* $Id: php_sysvmsg.h,v 1.6.2.1.2.2 2007/01/08 22:34:07 nlopess Exp $ */
 
 #ifndef PHP_SYSVMSG_H
 #define PHP_SYSVMSG_H
@@ -40,9 +40,6 @@
 #endif
 
 PHP_MINIT_FUNCTION(sysvmsg);
-PHP_MSHUTDOWN_FUNCTION(sysvmsg);
-PHP_RINIT_FUNCTION(sysvmsg);
-PHP_RSHUTDOWN_FUNCTION(sysvmsg);
 PHP_MINFO_FUNCTION(sysvmsg);
 
 PHP_FUNCTION(msg_get_queue);
http://cvs.php.net/viewvc.cgi/php-src/ext/sysvmsg/sysvmsg.c?r1=1.20.2.3.2.4&r2=1.20.2.3.2.5&diff_format=u
Index: php-src/ext/sysvmsg/sysvmsg.c
diff -u php-src/ext/sysvmsg/sysvmsg.c:1.20.2.3.2.4 
php-src/ext/sysvmsg/sysvmsg.c:1.20.2.3.2.5
--- php-src/ext/sysvmsg/sysvmsg.c:1.20.2.3.2.4  Fri Jan  5 15:06:55 2007
+++ php-src/ext/sysvmsg/sysvmsg.c   Mon Jan  8 22:34:07 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: sysvmsg.c,v 1.20.2.3.2.4 2007/01/05 15:06:55 iliaa Exp $ */
+/* $Id: sysvmsg.c,v 1.20.2.3.2.5 2007/01/08 22:34:07 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -84,7 +84,7 @@
"sysvmsg",
sysvmsg_functions,
PHP_MINIT(sysvmsg),
-   PHP_MSHUTDOWN(sysvmsg),
+   NULL,
NULL,
NULL,
PHP_MINFO(sysvmsg),
@@ -130,21 +130,13 @@
 }
 /* }}} */
 
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(sysvmsg)
-{
-   return SUCCESS;
-}
-/* }}} */
-
 /* {{{ PHP_MINFO_FUNCTION
  */
 PHP_MINFO_FUNCTION(sysvmsg)
 {
php_info_print_table_start();
php_info_print_table_row(2, "sysvmsg support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.20.2.3.2.4 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.20.2.3.2.5 $");
php_info_print_table_end();
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/hash hash.c hash_adler32.c hash_crc32.c hash_gost.c hash_haval.c hash_md.c hash_ripemd.c hash_salsa.c hash_sha.c hash_snefru.c hash_tiger.c hash_whirlpool.c php_hash.h

2007-01-08 Thread Nuno Lopes
nlopess Mon Jan  8 22:29:52 2007 UTC

  Modified files:  
/php-src/ext/hash   hash.c hash_adler32.c hash_crc32.c hash_gost.c 
hash_haval.c hash_md.c hash_ripemd.c hash_salsa.c 
hash_sha.c hash_snefru.c hash_tiger.c 
hash_whirlpool.c php_hash.h 
  Log:
  MFB: constify
  http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash.c?r1=1.33&r2=1.34&diff_format=u
Index: php-src/ext/hash/hash.c
diff -u php-src/ext/hash/hash.c:1.33 php-src/ext/hash/hash.c:1.34
--- php-src/ext/hash/hash.c:1.33Mon Jan  1 09:29:24 2007
+++ php-src/ext/hash/hash.c Mon Jan  8 22:29:52 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: hash.c,v 1.33 2007/01/01 09:29:24 sebastian Exp $ */
+/* $Id: hash.c,v 1.34 2007/01/08 22:29:52 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -37,7 +37,7 @@
 
 /* Hash Registry Access */
 
-PHP_HASH_API php_hash_ops *php_hash_fetch_ops(const char *algo, int algo_len)
+PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, int 
algo_len)
 {
php_hash_ops *ops;
char *lower = estrndup(algo, algo_len);
@@ -51,13 +51,13 @@
return ops;
 }
 
-PHP_HASH_API void php_hash_register_algo(const char *algo, php_hash_ops *ops)
+PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops 
*ops)
 {
int algo_len = strlen(algo);
char *lower = estrndup(algo, algo_len);

zend_str_tolower(lower, algo_len);
-   zend_hash_add(&php_hash_hashtable, lower, algo_len + 1, ops, 
sizeof(php_hash_ops), NULL);
+   zend_hash_add(&php_hash_hashtable, lower, algo_len + 1, (void*)ops, 
sizeof(php_hash_ops), NULL);
efree(lower);
 }
 
@@ -69,7 +69,7 @@
int algo_len, data_len;
zend_uchar data_type = IS_STRING;
zend_bool raw_output = 0;
-   php_hash_ops *ops;
+   const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
 
@@ -180,7 +180,7 @@
int algo_len, data_len, key_len, i;
zend_uchar data_type = IS_STRING, key_type = IS_STRING;
zend_bool raw_output = 0;
-   php_hash_ops *ops;
+   const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
 
@@ -344,7 +344,7 @@
zend_uchar key_type;
long options = 0;
void *context;
-   php_hash_ops *ops;
+   const php_hash_ops *ops;
php_hash_data *hash;
 
if (zend_parse_parameters(argc TSRMLS_CC, "s|lt", &algo, &algo_len, 
&options, &key, &key_len, &key_type) == FAILURE) {
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_adler32.c?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/hash/hash_adler32.c
diff -u php-src/ext/hash/hash_adler32.c:1.6 php-src/ext/hash/hash_adler32.c:1.7
--- php-src/ext/hash/hash_adler32.c:1.6 Mon Jan  1 09:29:24 2007
+++ php-src/ext/hash/hash_adler32.c Mon Jan  8 22:29:52 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: hash_adler32.c,v 1.6 2007/01/01 09:29:24 sebastian Exp $ */
+/* $Id: hash_adler32.c,v 1.7 2007/01/08 22:29:52 nlopess Exp $ */
 
 #include "php_hash.h"
 #include "php_hash_adler32.h"
@@ -49,7 +49,7 @@
context->state = 0;
 }
 
-php_hash_ops php_hash_adler32_ops = {
+const php_hash_ops php_hash_adler32_ops = {
(php_hash_init_func_t) PHP_ADLER32Init,
(php_hash_update_func_t) PHP_ADLER32Update,
(php_hash_final_func_t) PHP_ADLER32Final,
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_crc32.c?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/hash/hash_crc32.c
diff -u php-src/ext/hash/hash_crc32.c:1.4 php-src/ext/hash/hash_crc32.c:1.5
--- php-src/ext/hash/hash_crc32.c:1.4   Mon Jan  1 09:29:24 2007
+++ php-src/ext/hash/hash_crc32.c   Mon Jan  8 22:29:52 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: hash_crc32.c,v 1.4 2007/01/01 09:29:24 sebastian Exp $ */
+/* $Id: hash_crc32.c,v 1.5 2007/01/08 22:29:52 nlopess Exp $ */
 
 #include "php_hash.h"
 #include "php_hash_crc32.h"
@@ -56,7 +56,7 @@
context->state = 0;
 }
 
-php_hash_ops php_hash_crc32_ops = {
+const php_hash_ops php_hash_crc32_ops = {
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32Update,
(php_hash_final_func_t) PHP_CRC32Final,
@@ -65,7 +65,7 @@
sizeof(PHP_CRC32_CTX)
 };
 
-php_hash_ops php_hash_crc32b_ops = {
+const php_hash_ops php_hash_crc32b_ops = {
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32BUpdate,
(php_hash_final_func_t) PHP_CRC32Final,
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_gost.c?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/hash/hash_gost.c
diff -u php-src/ext/hash/hash_gost.c:1.4 php-src/ext/hash/hash_gost.c:1.5
--- php-src/ext/hash/hash_gost.c:1.4Mon Jan  1 09:29:

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/hash hash.c hash_adler32.c hash_crc32.c hash_gost.c hash_haval.c hash_md.c hash_ripemd.c hash_salsa.c hash_sha.c hash_snefru.c hash_tiger.c hash_whirlpool.c php_ha

2007-01-08 Thread Nuno Lopes
nlopess Mon Jan  8 22:29:26 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/hash   hash.c hash_adler32.c hash_crc32.c hash_gost.c 
hash_haval.c hash_md.c hash_ripemd.c hash_salsa.c 
hash_sha.c hash_snefru.c hash_tiger.c 
hash_whirlpool.c php_hash.h 
  Log:
  make the hash_ops structures const and save some memory
  # ram memory is so expensive these days...
  http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash.c?r1=1.18.2.5.2.5&r2=1.18.2.5.2.6&diff_format=u
Index: php-src/ext/hash/hash.c
diff -u php-src/ext/hash/hash.c:1.18.2.5.2.5 
php-src/ext/hash/hash.c:1.18.2.5.2.6
--- php-src/ext/hash/hash.c:1.18.2.5.2.5Mon Jan  1 09:36:01 2007
+++ php-src/ext/hash/hash.c Mon Jan  8 22:29:25 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: hash.c,v 1.18.2.5.2.5 2007/01/01 09:36:01 sebastian Exp $ */
+/* $Id: hash.c,v 1.18.2.5.2.6 2007/01/08 22:29:25 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -37,7 +37,7 @@
 
 /* Hash Registry Access */
 
-PHP_HASH_API php_hash_ops *php_hash_fetch_ops(const char *algo, int algo_len)
+PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, int 
algo_len)
 {
php_hash_ops *ops;
char *lower = estrndup(algo, algo_len);
@@ -51,13 +51,13 @@
return ops;
 }
 
-PHP_HASH_API void php_hash_register_algo(const char *algo, php_hash_ops *ops)
+PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops 
*ops)
 {
int algo_len = strlen(algo);
char *lower = estrndup(algo, algo_len);

zend_str_tolower(lower, algo_len);
-   zend_hash_add(&php_hash_hashtable, lower, algo_len + 1, ops, 
sizeof(php_hash_ops), NULL);
+   zend_hash_add(&php_hash_hashtable, lower, algo_len + 1, (void*)ops, 
sizeof(php_hash_ops), NULL);
efree(lower);
 }
 
@@ -68,7 +68,7 @@
char *algo, *data, *digest;
int algo_len, data_len;
zend_bool raw_output = 0;
-   php_hash_ops *ops;
+   const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
 
@@ -142,7 +142,7 @@
char *algo, *data, *digest, *key, *K;
int algo_len, data_len, key_len, i;
zend_bool raw_output = 0;
-   php_hash_ops *ops;
+   const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
 
@@ -255,7 +255,7 @@
int algo_len, key_len = 0, argc = ZEND_NUM_ARGS();
long options = 0;
void *context;
-   php_hash_ops *ops;
+   const php_hash_ops *ops;
php_hash_data *hash;
 
if (zend_parse_parameters(argc TSRMLS_CC, "s|ls", &algo, &algo_len, 
&options, &key, &key_len) == FAILURE) {
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_adler32.c?r1=1.3.2.4.2.1&r2=1.3.2.4.2.2&diff_format=u
Index: php-src/ext/hash/hash_adler32.c
diff -u php-src/ext/hash/hash_adler32.c:1.3.2.4.2.1 
php-src/ext/hash/hash_adler32.c:1.3.2.4.2.2
--- php-src/ext/hash/hash_adler32.c:1.3.2.4.2.1 Mon Jan  1 09:36:01 2007
+++ php-src/ext/hash/hash_adler32.c Mon Jan  8 22:29:25 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: hash_adler32.c,v 1.3.2.4.2.1 2007/01/01 09:36:01 sebastian Exp $ */
+/* $Id: hash_adler32.c,v 1.3.2.4.2.2 2007/01/08 22:29:25 nlopess Exp $ */
 
 #include "php_hash.h"
 #include "php_hash_adler32.h"
@@ -49,7 +49,7 @@
context->state = 0;
 }
 
-php_hash_ops php_hash_adler32_ops = {
+const php_hash_ops php_hash_adler32_ops = {
(php_hash_init_func_t) PHP_ADLER32Init,
(php_hash_update_func_t) PHP_ADLER32Update,
(php_hash_final_func_t) PHP_ADLER32Final,
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_crc32.c?r1=1.2.2.3.2.1&r2=1.2.2.3.2.2&diff_format=u
Index: php-src/ext/hash/hash_crc32.c
diff -u php-src/ext/hash/hash_crc32.c:1.2.2.3.2.1 
php-src/ext/hash/hash_crc32.c:1.2.2.3.2.2
--- php-src/ext/hash/hash_crc32.c:1.2.2.3.2.1   Mon Jan  1 09:36:01 2007
+++ php-src/ext/hash/hash_crc32.c   Mon Jan  8 22:29:25 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: hash_crc32.c,v 1.2.2.3.2.1 2007/01/01 09:36:01 sebastian Exp $ */
+/* $Id: hash_crc32.c,v 1.2.2.3.2.2 2007/01/08 22:29:25 nlopess Exp $ */
 
 #include "php_hash.h"
 #include "php_hash_crc32.h"
@@ -56,7 +56,7 @@
context->state = 0;
 }
 
-php_hash_ops php_hash_crc32_ops = {
+const php_hash_ops php_hash_crc32_ops = {
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32Update,
(php_hash_final_func_t) PHP_CRC32Final,
@@ -65,7 +65,7 @@
sizeof(PHP_CRC32_CTX)
 };
 
-php_hash_ops php_hash_crc32b_ops = {
+const php_hash_ops php_hash_crc32b_ops = {
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32BUpdate,
(php_hash_final_func_t) 

<    1   2   3   4   5   6   7   >