[PHP-CVS] cvs: php4 /ext/exif/tests 002.phpt

2002-10-15 Thread Derick Rethans

derick  Tue Oct 15 02:37:06 2002 EDT

  Modified files:  
/php4/ext/exif/tests002.phpt 
  Log:
  - Staying consistent with other tests
  
  
Index: php4/ext/exif/tests/002.phpt
diff -u php4/ext/exif/tests/002.phpt:1.4 php4/ext/exif/tests/002.phpt:1.5
--- php4/ext/exif/tests/002.phpt:1.4Mon Oct 14 20:35:05 2002
+++ php4/ext/exif/tests/002.phptTue Oct 15 02:37:05 2002
 -4,8 +4,8 
 ?php if (!extension_loaded(exif)) print skip;?
 --INI--
 magic_quotes_runtime=0
-output_handler = 
-zlib.output_compression = Off 
+output_handler= 
+zlib.output_compression=0 
 --FILE--
 ?php
 /*



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




[PHP-CVS] cvs: php4 /ext/ircg README.txt

2002-10-15 Thread Sascha Schumann

sas Tue Oct 15 03:26:49 2002 EDT

  Modified files:  
/php4/ext/ircg  README.txt 
  Log:
  update
  
  
Index: php4/ext/ircg/README.txt
diff -u php4/ext/ircg/README.txt:1.15 php4/ext/ircg/README.txt:1.16
--- php4/ext/ircg/README.txt:1.15   Tue Jul 16 12:24:12 2002
+++ php4/ext/ircg/README.txtTue Oct 15 03:26:49 2002
 -15,7 +15,7 
 
 
 
-($Id: README.txt,v 1.15 2002/07/16 16:24:12 sas Exp $)
+($Id: README.txt,v 1.16 2002/10/15 07:26:49 sas Exp $)
 
 STATUS
 
 -25,42 +25,16 
 
 

-INSTALLATION: THE QUICK WAY
+INSTALLATION: THE QUICK AND EASY WAY
 
 
 1.  Download
 
 http://schumann.cx/ircg/install_ircg.sh
 
-2.  You can edit some variables at the top of that script, if necessary:
-
-prefix
-The directory where all software is installed in.  Note that
-the user which runs the script shall have write permissions
-for that directory.
-
-php4_sourcedir
-   A compatible version of the PHP 4.0 source-code, fully buildconf'd.
-
-st_target
-The State Threads target (e.g. freebsd-optimized)
-
-st_targetdir
-The State Threads directory name (e.g. FREEBSD_`uname -r`_OPT)
-
-On Solaris 2.x, this is the output of uname -r minus 3
-(e.g. 5.8 becomes 2.8).
-
-make
-The name of GNU make on your system (some packages depend
-on it).
-
-thttpd, IRCG, st(usually don't need to be changed)
-Version numbers of the respective software package which
-are known to work.  Please _don't_ change.
-If you change thttpd, ensure that PHP indeed supports
-that version.  Currently, only thttpd 2.21b and no later/earlier
-version are supported.
+2.  Open the script in your favorite editor and set up the three
+variables for installation prefix, PHP 4 source directory and
+Operating System.  Please refer to the comments inside the script.
 
 3.  Run
 
 -72,7 +46,7 
 
 Note 1:  Currently, the shipped patches are in the unified diff
 format.  Some esoteric patch tools cannot handle that format.  On
-those systems, installing GNU patch is recommened.
+those systems, installing GNU patch is recommended.
 
 ftp://ftp.gnu.org/pub/gnu/patch/

 -85,6 +59,10 
 
 
 THE LONG AND BORING WAY
+
+Unless there is a specific reason (like you are bored or generally
+have too much time on your hands), you are advised to use the
+installation script as outlined above.
 
 
 1.  Install SGI's State Threads Library



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




[PHP-CVS] NetWare changes to 4.2 source code branch.

2002-10-15 Thread Ananth Kesari

Hi all,

I am working on porting PHP onto NetWare.
Currently, we are shipping the older version 4.0.8
on NetWare. We are moving to the latest stable version.
Zeev Suraski suggested that we move to 4.2 branch
since it is significantly more stable than 4.3 branch.

So, I would be checking in NetWare patches into the
4.2 source code branch in a few days from now.
This is for your information.

Thanks,
Ananth.



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




[PHP-CVS] cvs: php4 /ext/standard formatted_print.c

2002-10-15 Thread Ilia Alshanetsky

iliaa   Tue Oct 15 08:07:39 2002 EDT

  Modified files:  
/php4/ext/standard  formatted_print.c 
  Log:
  Fixed bug #4232. (Added support for %e and %E to printf/sprintf)
  
  
Index: php4/ext/standard/formatted_print.c
diff -u php4/ext/standard/formatted_print.c:1.56 
php4/ext/standard/formatted_print.c:1.57
--- php4/ext/standard/formatted_print.c:1.56Mon Oct 14 12:03:16 2002
+++ php4/ext/standard/formatted_print.c Tue Oct 15 08:07:36 2002
 -16,7 +16,7 
+--+
  */
 
-/* $Id: formatted_print.c,v 1.56 2002/10/14 16:03:16 iliaa Exp $ */
+/* $Id: formatted_print.c,v 1.57 2002/10/15 12:07:36 iliaa Exp $ */
 
 #include math.h  /* modf() */
 #include php.h
 -332,6 +332,31 
numbuf[i++] = cvt[j++];
if (precision  0)
numbuf[i++] = decimal_point;
+   }
+   } else if (fmt == 'e' || fmt == 'E') {
+   char *exp_p;
+   int dec2;
+   
+   decpt--;
+   
+   numbuf[i++] = cvt[j++];
+   numbuf[i++] = decimal_point;
+
+   if (precision  0) {
+   int k = precision;
+   
+   while (k--  cvt[j]) {
+   numbuf[i++] = cvt[j++];
+   }
+   } else {
+   numbuf[i++] = '0';
+   }
+   
+   numbuf[i++] = fmt;
+   exp_p = php_convert_to_decimal(decpt, 0, dec2, sign, 0);
+   numbuf[i++] = sign ? '-' : '+';
+   while (*exp_p) {
+   numbuf[i++] = *(exp_p++);
}
} else {
numbuf[i++] = cvt[j++];



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




[PHP-CVS] cvs: php4 /ext/standard/tests/general_functions 001.phpt

2002-10-15 Thread Ilia Alshanetsky

iliaa   Tue Oct 15 08:08:03 2002 EDT

  Modified files:  
/php4/ext/standard/tests/general_functions  001.phpt 
  Log:
  Added tests for %e  %E 
  
  
Index: php4/ext/standard/tests/general_functions/001.phpt
diff -u php4/ext/standard/tests/general_functions/001.phpt:1.2 
php4/ext/standard/tests/general_functions/001.phpt:1.3
--- php4/ext/standard/tests/general_functions/001.phpt:1.2  Mon Oct 14 12:31:56 
2002
+++ php4/ext/standard/tests/general_functions/001.phpt  Tue Oct 15 08:08:02 2002
 -48,6 +48,12 
 
 echo sprintf(%.2f\n, 99.00);
 echo sprintf(%.2f\n, 99.00);
+
+echo sprintf(%e\n, 1.234E-18);
+echo sprintf(%e\n, 1.234E+18);
+echo sprintf(%e\n, 9843243.12);
+echo sprintf(%e\n, -9843243.12);
+
 ?
 --EXPECT--
 sprintf string truncate test:   passed
 -57,3 +63,7 
 sprintf float test: passed
 99.00
 99.00
+1.23400e-18
+1.23400e+18
+9.84324e+6
+-9.84324e+6



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




[PHP-CVS] cvs: php4 /ext/exif/tests 002.phpt

2002-10-15 Thread Ilia Alshanetsky

iliaa   Tue Oct 15 08:48:21 2002 EDT

  Modified files:  
/php4/ext/exif/tests002.phpt 
  Log:
  Fixed the output_handler ini setting.
  Code cleanup.
  
  
  
Index: php4/ext/exif/tests/002.phpt
diff -u php4/ext/exif/tests/002.phpt:1.5 php4/ext/exif/tests/002.phpt:1.6
--- php4/ext/exif/tests/002.phpt:1.5Tue Oct 15 02:37:05 2002
+++ php4/ext/exif/tests/002.phptTue Oct 15 08:48:21 2002
 -4,7 +4,7 
 ?php if (!extension_loaded(exif)) print skip;?
 --INI--
 magic_quotes_runtime=0
-output_handler= 
+output_handler=
 zlib.output_compression=0 
 --FILE--
 ?php
 -13,16 +13,12 
   test2.jpg is the same image but contains Exif/Comment information and a
 copy of test1.jpg as a thumbnail.
 */
-$infile= './ext/exif/tests/test1.jpg';
-$fp= fopen($infile,'rb');
-$image = fread($fp,filesize($infile));
-//$image = stripslashes($image);
-echo md5($image).'_'.filesize($infile);
-fclose($fp);
+$infile = './ext/exif/tests/test1.jpg';
+echo md5_file($infile).'_'.filesize($infile);
 $thumb = exif_thumbnail('./ext/exif/tests/test2.jpg');
-echo strcmp($image,$thumb) ? '_different_' : '_identical_';
-echo strlen($thumb).'_'.md5($thumb);
+echo  == ;
+echo md5($thumb).'_'.strlen($thumb);
 echo \n;
 ?
 --EXPECT--
-27bbfd9fc10e1e663d749f5225447905_523_identical_523_27bbfd9fc10e1e663d749f5225447905
+27bbfd9fc10e1e663d749f5225447905_523 == 27bbfd9fc10e1e663d749f5225447905_523



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




[PHP-CVS] cvs: php4 /ext/standard math.c

2002-10-15 Thread Sterling Hughes

sterlingTue Oct 15 10:51:01 2002 EDT

  Modified files:  
/php4/ext/standard  math.c 
  Log:
  hopefully silence compile warnings on Solaris related to HUGEVAL being 
  undefined.. HUGEVAL is defined (well the manual would indicate so) in 
  stdlib.h, not math.h.
  
  Bug #: 19807
  
  
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.89 php4/ext/standard/math.c:1.90
--- php4/ext/standard/math.c:1.89   Thu Oct  3 22:21:33 2002
+++ php4/ext/standard/math.cTue Oct 15 10:51:01 2002
 -19,13 +19,14 
+--+
 */
 
-/* $Id: math.c,v 1.89 2002/10/04 02:21:33 sas Exp $ */
+/* $Id: math.c,v 1.90 2002/10/15 14:51:01 sterling Exp $ */
 
 #include php.h
 #include php_math.h
 
 #include math.h
 #include float.h
+#include stdlib.h
 
 #ifndef M_PI
 #define M_PI 3.14159265358979323846
 -1078,6 +1079,6 
  * tab-width: 4
  * c-basic-offset: 4
  * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim600: sw=4 ts=4
+ * vim600: fdm=marker
+ * vim: noet sw=4 ts=4
  */



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




[PHP-CVS] cvs: php4 /main streams.c

2002-10-15 Thread Wez Furlong

wez Tue Oct 15 12:04:47 2002 EDT

  Modified files:  
/php4/main  streams.c 
  Log:
  Some buffer paranoia.
  Also, make feof() detection safer (ala recent changes to zlib extension).
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.105 php4/main/streams.c:1.106
--- php4/main/streams.c:1.105   Mon Oct 14 01:38:50 2002
+++ php4/main/streams.c Tue Oct 15 12:04:46 2002
 -20,7 +20,7 
+--+
  */
 
-/* $Id: streams.c,v 1.105 2002/10/14 05:38:50 wez Exp $ */
+/* $Id: streams.c,v 1.106 2002/10/15 16:04:46 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
 -808,6 +808,10 
buf += justwrote;
count -= justwrote;
didwrite += justwrote;
+   
+   /* FIXME: invalidate the whole readbuffer */
+   stream-writepos = 0;
+   stream-readpos = 0;
} else {
break;
}
 -827,24 +831,26 
return 0;
 
/* handle the case where we are in the buffer */
-   switch(whence) {
-   case SEEK_CUR:
-   if (offset  0  offset  stream-writepos - stream-readpos) 
{
-   stream-readpos += offset;
-   stream-position += offset;
-   stream-eof = 0;
-   return 0;
-   }
-   break;
-   case SEEK_SET:
-   if (offset  stream-position 
-   offset  stream-position + stream-writepos - 
stream-readpos) {
-   stream-readpos += offset - stream-position;
-   stream-position = offset;
-   stream-eof = 0;
-   return 0;
-   }
-   break;
+   if ((stream-flags  PHP_STREAM_FLAG_NO_BUFFER) == 0) {
+   switch(whence) {
+   case SEEK_CUR:
+   if (offset  0  offset  stream-writepos - 
+stream-readpos) {
+   stream-readpos += offset;
+   stream-position += offset;
+   stream-eof = 0;
+   return 0;
+   }
+   break;
+   case SEEK_SET:
+   if (offset  stream-position 
+   offset  stream-position + 
+stream-writepos - stream-readpos) {
+   stream-readpos += offset - stream-position;
+   stream-position = offset;
+   stream-eof = 0;
+   return 0;
+   }
+   break;
+   }
}

/* invalidate the buffer contents */
 -1286,7 +1292,7 
 
ret = fread(buf, 1, count, data-file);
 
-   if (ret == 0  feof(data-file))
+   if (feof(data-file))
stream-eof = 1;
}
return ret;



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




Re: [PHP-CVS] cvs: php4 /ext/mbstring mbstring.c

2002-10-15 Thread Moriyoshi Koizumi

Hello,

I think this change won't enough for the expected behaviour, because

sapi_register_treat_data(mbstr_treat_data);

is only invoked in tne PHP_MINIT_FUNCTION(mbstring), and would never be 
invoked on a request when the encoding_translation is turned off globally, 
and it is on in per-dir settings, though.


Rui Hirokawa [EMAIL PROTECTED] wrote:

 hirokawa  Fri Oct 11 21:18:44 2002 EDT
 
   Modified files:  
 /php4/ext/mbstringmbstring.c 
   Log:
   changed INI restriction to enable per-directory settings.
   
   
 Index: php4/ext/mbstring/mbstring.c
 diff -u php4/ext/mbstring/mbstring.c:1.101 php4/ext/mbstring/mbstring.c:1.102
 --- php4/ext/mbstring/mbstring.c:1.101Tue Oct  8 13:20:10 2002
 +++ php4/ext/mbstring/mbstring.c  Fri Oct 11 21:18:43 2002
 @@ -17,7 +17,7 @@
 +--+
   */
  
 -/* $Id: mbstring.c,v 1.101 2002/10/08 17:20:10 moriyoshi Exp $ */
 +/* $Id: mbstring.c,v 1.102 2002/10/12 01:18:43 hirokawa Exp $ */
  
  /*
   * PHP4 Multibyte String module mbstring (currently only for Japanese)
 @@ -646,7 +646,7 @@
  
  /* php.ini directive registration */
  PHP_INI_BEGIN()
 -  PHP_INI_ENTRY(mbstring.language, NULL, PHP_INI_ALL, 
OnUpdate_mbstring_language)
 +  PHP_INI_ENTRY(mbstring.language, NULL, PHP_INI_SYSTEM | PHP_INI_PERDIR, 
OnUpdate_mbstring_language)
PHP_INI_ENTRY(mbstring.detect_order, NULL, PHP_INI_ALL, 
OnUpdate_mbstring_detect_order)
PHP_INI_ENTRY(mbstring.http_input, NULL, PHP_INI_ALL, 
OnUpdate_mbstring_http_input)
PHP_INI_ENTRY(mbstring.http_output, NULL, PHP_INI_ALL, 
OnUpdate_mbstring_http_output)
 @@ -655,8 +655,10 @@
PHP_INI_ENTRY(mbstring.script_encoding, NULL, PHP_INI_ALL, 
OnUpdate_mbstring_script_encoding)
  #endif /* ZEND_MULTIBYTE */
PHP_INI_ENTRY(mbstring.substitute_character, NULL, PHP_INI_ALL, 
OnUpdate_mbstring_substitute_character)
 -  STD_PHP_INI_ENTRY(mbstring.func_overload, 0, PHP_INI_SYSTEM, OnUpdateInt, 
func_overload, zend_mbstring_globals, mbstring_globals)
 -  STD_PHP_INI_BOOLEAN(mbstring.encoding_translation, 0, PHP_INI_ALL, 
OnUpdateBool, encoding_translation, zend_mbstring_globals, mbstring_globals)
 +  STD_PHP_INI_ENTRY(mbstring.func_overload, 0, PHP_INI_SYSTEM |
 +  PHP_INI_PERDIR, OnUpdateInt, func_overload, zend_mbstring_globals, 
mbstring_globals)
 +  STD_PHP_INI_BOOLEAN(mbstring.encoding_translation, 0,
 +  PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdateBool, encoding_translation, 
zend_mbstring_globals, mbstring_globals)
  PHP_INI_END()
  
  
 
 
 
 -- 
 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: php4 /main streams.c

2002-10-15 Thread Wez Furlong

wez Tue Oct 15 12:38:11 2002 EDT

  Modified files:  
/php4/main  streams.c 
  Log:
  Fix mem leak for zero-byte files.
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.106 php4/main/streams.c:1.107
--- php4/main/streams.c:1.106   Tue Oct 15 12:04:46 2002
+++ php4/main/streams.c Tue Oct 15 12:38:11 2002
 -20,7 +20,7 
+--+
  */
 
-/* $Id: streams.c,v 1.106 2002/10/15 16:04:46 wez Exp $ */
+/* $Id: streams.c,v 1.107 2002/10/15 16:38:11 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
 -1028,7 +1028,7 
 #endif

srcfile = mmap(NULL, maxlen, PROT_READ, MAP_SHARED, srcfd, 0);
-   if (srcfile != (void*)MAP_FAILED) {
+   if (srcfile != (void*)MAP_FAILED  ret  0) {
 
*buf = pemalloc_rel_orig(maxlen + 1, persistent);
 



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




[PHP-CVS] cvs: php4 /ext/xslt php_sablot.h sablot.c

2002-10-15 Thread Sterling Hughes

sterlingTue Oct 15 12:41:38 2002 EDT

  Modified files:  
/php4/ext/xslt  php_sablot.h sablot.c 
  Log:
  Fix a problem relating to these structure symbols being redefined on LFS 
  systems.
  
  Fix by Sascha Schumann [EMAIL PROTECTED]
  
  
Index: php4/ext/xslt/php_sablot.h
diff -u php4/ext/xslt/php_sablot.h:1.13 php4/ext/xslt/php_sablot.h:1.14
--- php4/ext/xslt/php_sablot.h:1.13 Sun Oct  6 12:32:23 2002
+++ php4/ext/xslt/php_sablot.h  Tue Oct 15 12:41:38 2002
@@ -70,11 +70,11 @@
 
 
 struct scheme_handlers {
-   zval *get_all;
-   zval *open;
-   zval *get;
-   zval *put;
-   zval *close;
+   zval *sh_get_all;
+   zval *sh_open;
+   zval *sh_get;
+   zval *sh_put;
+   zval *sh_close;
 };
 
 struct sax_handlers {
Index: php4/ext/xslt/sablot.c
diff -u php4/ext/xslt/sablot.c:1.57 php4/ext/xslt/sablot.c:1.58
--- php4/ext/xslt/sablot.c:1.57 Sun Oct  6 12:32:23 2002
+++ php4/ext/xslt/sablot.c  Tue Oct 15 12:41:38 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: sablot.c,v 1.57 2002/10/06 16:32:23 msopacua Exp $ */
+/* $Id: sablot.c,v 1.58 2002/10/15 16:41:38 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -349,23 +349,23 @@
 
/* Open the URI and return the whole string */
if (strcasecmp(string_key, get_all) == 0) {
-   assign_handle = XSLT_SCHEME(handle).get_all;
+   assign_handle = XSLT_SCHEME(handle).sh_get_all;
}
/* Open the URI and return a handle */
else if (strcasecmp(string_key, open) == 0) {
-   assign_handle = XSLT_SCHEME(handle).open;
+   assign_handle = XSLT_SCHEME(handle).sh_open;
}
/* Retrieve data from the URI */
else if (strcasecmp(string_key, get) == 0) {
-   assign_handle = XSLT_SCHEME(handle).get;
+   assign_handle = XSLT_SCHEME(handle).sh_get;
}
/* Save data to the URI */
else if (strcasecmp(string_key, put) == 0) {
-   assign_handle = XSLT_SCHEME(handle).put;
+   assign_handle = XSLT_SCHEME(handle).sh_put;
}
/* Close the URI */
else if (strcasecmp(string_key, close) == 0) {
-   assign_handle = XSLT_SCHEME(handle).close;
+   assign_handle = XSLT_SCHEME(handle).sh_close;
}
/* Invalid handler name */
else {
@@ -751,11 +751,11 @@
}
 
/* Free Scheme handlers */
-   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).get_all);
-   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).open);
-   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).get);
-   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).put);
-   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).close);
+   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).sh_get_all);
+   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).sh_open);
+   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).sh_get);
+   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).sh_put);
+   XSLT_FUNCH_FREE(XSLT_SCHEME(handle).sh_close);
/* Free SAX handlers */
XSLT_FUNCH_FREE(XSLT_SAX(handle).doc_start);
XSLT_FUNCH_FREE(XSLT_SAX(handle).element_start);
@@ -830,7 +830,7 @@
 
/* If the scheme handler get all function doesn't
   exist, exit out */
-   if (!XSLT_SCHEME(handle).get_all) {
+   if (!XSLT_SCHEME(handle).sh_get_all) {
return 0;
}
 
@@ -848,7 +848,7 @@
ZVAL_STRING(argv[1], (char *) scheme, 1);
ZVAL_STRING(argv[2], (char *) rest, 1);
 
-   xslt_call_function(scheme get all, XSLT_SCHEME(handle).get_all, 
handle-object, 
+   xslt_call_function(scheme get all, XSLT_SCHEME(handle).sh_get_all, 
+handle-object, 
   3, argv, retval);
 
if (!retval) {
@@ -874,11 +874,11 @@
 {
/* If one of the functions is exists, then scheme
   handlers are registered */
-   if (XSLT_SCHEME(handle).get_all  ||
-   XSLT_SCHEME(handle).open ||
-   XSLT_SCHEME(handle).get  ||
-   XSLT_SCHEME(handle).put  ||
-   XSLT_SCHEME(handle).close)
+   if (XSLT_SCHEME(handle).sh_get_all  ||
+   XSLT_SCHEME(handle).sh_open ||
+   XSLT_SCHEME(handle).sh_get  ||
+   XSLT_SCHEME(handle).sh_put  ||
+   XSLT_SCHEME(handle).sh_close)
return 1;
/* otherwise, no cigar */
else
@@ -913,7 +913,7 @@
 TSRMLS_FETCH();
 
/* If no open handler exists, let's exit */
-   if (!XSLT_SCHEME(handle).open) {
+   if (!XSLT_SCHEME(handle).sh_open) {
return 0;
}
 
@@ -932,7 +932,7 @@
ZVAL_STRING(argv[2], (char *) rest, 1);


[PHP-CVS] cvs: php4 /ext/standard file.c /main streams.c

2002-10-15 Thread Wez Furlong

wez Tue Oct 15 12:45:27 2002 EDT

  Modified files:  
/php4/ext/standard  file.c 
/php4/main  streams.c 
  Log:
  Nope, that last one wasn't a leak in main/streams.c, it was
  file_get_contents misinterpreting the result...
  
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.269 php4/ext/standard/file.c:1.270
--- php4/ext/standard/file.c:1.269  Sun Oct 13 22:28:35 2002
+++ php4/ext/standard/file.cTue Oct 15 12:45:26 2002
 -21,7 +21,7 
+--+
  */
 
-/* $Id: file.c,v 1.269 2002/10/14 02:28:35 wez Exp $ */
+/* $Id: file.c,v 1.270 2002/10/15 16:45:26 wez Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
 -435,7 +435,7 
}
 
/* uses mmap if possible */
-   if ((len = php_stream_copy_to_mem(stream, contents, PHP_STREAM_COPY_ALL, 0)) 
 0) {
+   if ((len = php_stream_copy_to_mem(stream, contents, PHP_STREAM_COPY_ALL, 0)) 
+= 0) {

if (PG(magic_quotes_runtime)) {
contents = php_addslashes(contents, len, newlen, 1 
TSRMLS_CC); /* 1 = free source string */
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.107 php4/main/streams.c:1.108
--- php4/main/streams.c:1.107   Tue Oct 15 12:38:11 2002
+++ php4/main/streams.c Tue Oct 15 12:45:26 2002
 -20,7 +20,7 
+--+
  */
 
-/* $Id: streams.c,v 1.107 2002/10/15 16:38:11 wez Exp $ */
+/* $Id: streams.c,v 1.108 2002/10/15 16:45:26 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
 -1028,7 +1028,7 
 #endif

srcfile = mmap(NULL, maxlen, PROT_READ, MAP_SHARED, srcfd, 0);
-   if (srcfile != (void*)MAP_FAILED  ret  0) {
+   if (srcfile != (void*)MAP_FAILED) {
 
*buf = pemalloc_rel_orig(maxlen + 1, persistent);
 



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




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

2002-10-15 Thread Ilia Alshanetsky

iliaa   Tue Oct 15 12:47:02 2002 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  Fixed a bug in the calculation of the POST request length.
  
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.71 php4/run-tests.php:1.72
--- php4/run-tests.php:1.71 Mon Oct 14 05:32:36 2002
+++ php4/run-tests.php  Tue Oct 15 12:46:57 2002
 -303,7 +303,7 
$url_bits = parse_url(QA_SUBMISSION_PAGE);
if (empty($url_bits['port'])) $url_bits['port'] = 80;

-   $data = urlencode(base64_encode(preg_replace(/[\\x00]/, [0x0], $data)));
+   $data = php_test_data= . urlencode(base64_encode(preg_replace(/[\\x00]/, 
+[0x0], $data)));
$data_length = strlen($data);

$fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr, 10);
 -317,9 +317,8 
fwrite($fs, User-Agent: QA Browser 0.1\r\n);
fwrite($fs, Content-Type: application/x-www-form-urlencoded\r\n);
fwrite($fs, Content-Length: .$data_length.\r\n\r\n);
-   fwrite($fs, php_test_data=.$data);
+   fwrite($fs, $data);
fwrite($fs, \r\n\r\n);
-   fflush($fs);
fclose($fs);
 
return 1;



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




[PHP-CVS] cvs: php4 /win32 php4dllts.dsp

2002-10-15 Thread Markus Fischer

mfischerTue Oct 15 12:56:01 2002 EDT

  Modified files:  
/php4/win32 php4dllts.dsp 
  Log:
  - Define LINK_SIZE=2 needed for newly updated pcrelib; fixes Win32 build.
  
  # Getting linker warning about using local defined _php_pcre_exec now at the
  # end, anything serious ?
  
  
Index: php4/win32/php4dllts.dsp
diff -u php4/win32/php4dllts.dsp:1.86 php4/win32/php4dllts.dsp:1.87
--- php4/win32/php4dllts.dsp:1.86   Thu Sep 26 02:10:22 2002
+++ php4/win32/php4dllts.dspTue Oct 15 12:56:00 2002
 -450,22 +450,22 
 # Begin Source File
 
 SOURCE=..\ext\pcre\pcrelib\get.c
-# ADD CPP /D STATIC /D SUPPORT_UTF8
+# ADD CPP /D STATIC /D SUPPORT_UTF8 /D LINK_SIZE=2
 # End Source File
 # Begin Source File
 
 SOURCE=..\ext\pcre\pcrelib\maketables.c
-# ADD CPP /D STATIC /D SUPPORT_UTF8
+# ADD CPP /D STATIC /D SUPPORT_UTF8 /D LINK_SIZE=2
 # End Source File
 # Begin Source File
 
 SOURCE=..\ext\pcre\pcrelib\pcre.c
-# ADD CPP /D STATIC /D SUPPORT_UTF8
+# ADD CPP /D STATIC /D SUPPORT_UTF8 /D LINK_SIZE=2
 # End Source File
 # Begin Source File
 
 SOURCE=..\ext\pcre\pcrelib\study.c
-# ADD CPP /D STATIC /D SUPPORT_UTF8
+# ADD CPP /D STATIC /D SUPPORT_UTF8 /D LINK_SIZE=2
 # End Source File
 # End Group
 # Begin Group Header Files No. 3



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




[PHP-CVS] cvs: php4 / acinclude.m4

2002-10-15 Thread Jani Taskinen

sniper  Tue Oct 15 15:37:16 2002 EDT

  Modified files:  
/php4   acinclude.m4 
  Log:
  - Added PHP_PROG_SED which checks whether the sed in system works with
very long strings.
  
  #
  # Sascha, is this okay? I added this here since any libtool/autoconf
  # release out there doesn't have this yet..we can remove this when
  # we can really start requiring such versions which have it?
  #
  # This sets $SED to the correct binary, so that should be used in 
  # places were the lines might be very long.
  #
  
  
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.210 php4/acinclude.m4:1.211
--- php4/acinclude.m4:1.210 Wed Oct  2 08:52:53 2002
+++ php4/acinclude.m4   Tue Oct 15 15:37:16 2002
 -1,4 +1,4 
-dnl $Id: acinclude.m4,v 1.210 2002/10/02 12:52:53 helly Exp $
+dnl $Id: acinclude.m4,v 1.211 2002/10/15 19:37:16 sniper Exp $
 dnl
 dnl This file contains local autoconf functions.
 
 -1729,4 +1729,88 
   IFS=$ac_IFS
 
   APACHE_VERSION=`expr [$]4 \* 100 + [$]5 \* 1000 + [$]6`
+])
+
+dnl PHP_PROG_SED
+dnl 
+dnl Check for a fully-functional sed program, that truncates
+dnl as few characters as possible.  Prefer GNU sed if found.
+dnl
+dnl Based on LT_AC_PROG_SED (libtool CVS)
+dnl 
+AC_DEFUN([PHP_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(ac_cv_path_sed,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH; do
+  IFS=$as_save_IFS
+  test -z $as_dir  as_dir=.
+  for ac_prog in sed gsed; do
+if test -x $as_dir/$ac_prog; then
+  _sed_list=$_sed_list $as_dir/$ac_prog
+fi
+  done
+done
+
+  # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp  exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077  mktemp -d -q $TMPDIR/sedXX) 2/dev/null` 
+  test -n $tmp  test -d $tmp
+}  ||
+{
+  tmp=$TMPDIR/sed$$-$RANDOM
+  (umask 077  mkdir $tmp)
+} ||
+{
+   echo $me: cannot create a temporary directory in $TMPDIR 2
+   { (exit 1); exit 1; }
+}
+  _max=0
+  _count=0
+  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+  # along with /bin/sed that truncates output.
+  for _sed in $_sed_list /usr/xpg4/bin/sed; do
+test ! -f ${_sed}  break
+cat /dev/null  $tmp/sed.in
+_count=0
+echo -n 0123456789 $tmp/sed.in
+# Check for GNU sed and select it if it is found.
+if ${_sed} --version 21  /dev/null | egrep '(GNU)'  /dev/null; then
+  ac_cv_path_sed=${_sed}
+  break;
+fi
+while true; do
+  cat $tmp/sed.in $tmp/sed.in $tmp/sed.tmp
+  mv $tmp/sed.tmp $tmp/sed.in
+  cp $tmp/sed.in $tmp/sed.nl
+  echo $tmp/sed.nl
+  ${_sed} -e 's/a$//'  $tmp/sed.nl $tmp/sed.out || break
+  cmp -s $tmp/sed.out $tmp/sed.nl || break
+  # 1 chars as input seems more than enough
+  test $_count -gt 10  break
+  _count=`expr $_count + 1`
+  if test $_count -gt $_max; then
+_max=$_count
+ac_cv_path_sed=$_sed
+  fi
+done
+  done
+  rm -rf $tmp
+])
+if test -z $SED; then
+  AC_MSG_ERROR([Could not find working sed on this system. Please install GNU sed.])
+else
+  SED=$ac_cv_path_sed
+  AC_MSG_RESULT([$SED])
+fi
 ])



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




[PHP-CVS] cvs: php4(PHP_4_2_0) /main output.c

2002-10-15 Thread Yasuo Ohgaki

yohgaki Tue Oct 15 16:11:28 2002 EDT

  Modified files:  (Branch: PHP_4_2_0)
/php4/main  output.c 
  Log:
  Sync with head
  
  
Index: php4/main/output.c
diff -u php4/main/output.c:1.88.2.4 php4/main/output.c:1.88.2.5
--- php4/main/output.c:1.88.2.4 Tue Oct  1 06:25:31 2002
+++ php4/main/output.c  Tue Oct 15 16:11:27 2002
 -17,7 +17,7 
+--+
 */
 
-/* $Id: output.c,v 1.88.2.4 2002/10/01 10:25:31 yohgaki Exp $ */
+/* $Id: output.c,v 1.88.2.5 2002/10/15 20:11:27 yohgaki Exp $ */
 
 #include php.h
 #include ext/standard/head.h
 -368,14 +368,6 
memcpy(target, text, text_length);
target[text_length]=0;
 
-   /* If implicit_flush is On, send contents to next buffer and return.
-  Both PG() and OG() should be used since we should flush implicitly
-  always when implicit_flush is enabled in php.ini */
-   if (PG(implicit_flush) || OG(implicit_flush)) {
-   php_end_ob_buffer(1, 1 TSRMLS_CC);
-   return;
-   }
-   
if (OG(active_ob_buffer).chunk_size
 OG(active_ob_buffer).text_length = 
OG(active_ob_buffer).chunk_size) {
zval *output_handler = OG(active_ob_buffer).output_handler;



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




[PHP-CVS] cvs: php4 /ext/fribidi fribidi.dsp

2002-10-15 Thread Edin Kadribasic

edink   Tue Oct 15 20:02:33 2002 EDT

  Added files: 
/php4/ext/fribidi   fribidi.dsp 
  Log:
  Added win32 project file.
  
  

Index: php4/ext/fribidi/fribidi.dsp
+++ php4/ext/fribidi/fribidi.dsp
# Microsoft Developer Studio Project File - Name=fribidi - Package Owner=4
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE Win32 (x86) Dynamic-Link Library 0x0102

CFG=fribidi - Win32 Debug_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f fribidi.mak.
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f fribidi.mak CFG=fribidi - Win32 Debug_TS
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE fribidi - Win32 Release_TS (based on Win32 (x86) Dynamic-Link Library)
!MESSAGE fribidi - Win32 Debug_TS (based on Win32 (x86) Dynamic-Link Library)
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName 
# PROP Scc_LocalPath 
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe

!IF  $(CFG) == fribidi - Win32 Release_TS

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir Release_TS
# PROP BASE Intermediate_Dir Release_TS
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir 
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir Release_TS
# PROP Intermediate_Dir Release_TS
# PROP Ignore_Export_Lib 0
# PROP Target_Dir 
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D WIN32 /D NDEBUG /D _WINDOWS /D _MBCS 
/D _USRDLL /D FRIBIDI_EXPORTS /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I ..\.. /I ..\..\main /I ..\..\Zend /I 
..\..\TSRM /I ..\..\..\php_build /D ZEND_DEBUG=0 /D WIN32 /D NDEBUG /D 
_WINDOWS /D COMPILE_DL_FRIBIDI /D ZTS=1 /D ZEND_WIN32 /D PHP_WIN32 /D 
HAVE_FRIBIDI=1 /D PHP_FRIBIDI_EXPORTS /FR /YX /FD /c
# ADD BASE MTL /nologo /D NDEBUG /mktyplib203 /win32
# ADD MTL /nologo /D NDEBUG /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d NDEBUG
# ADD RSC /l 0x407 /d NDEBUG
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 
/nologo /dll /machine:I386
# ADD LINK32 fribidi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 
php4ts.lib /nologo /dll /machine:I386 /out:..\..\Release_TS/php_fribidi.dll 
/libpath:..\..\Release_TS /libpath:..\..\Release_TS_Inline 
/libpath:..\..\..\php_build\release

!ELSEIF  $(CFG) == fribidi - Win32 Debug_TS

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir Debug_TS
# PROP BASE Intermediate_Dir Debug_TS
# PROP BASE Target_Dir 
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir Debug_TS
# PROP Intermediate_Dir Debug_TS
# PROP Ignore_Export_Lib 0
# PROP Target_Dir 
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D WIN32 /D _DEBUG /D _WINDOWS 
/D _MBCS /D _USRDLL /D FRIBIDI_EXPORTS /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ..\.. /I ..\..\main /I ..\..\Zend 
/I ..\..\TSRM /I ..\..\..\php_build /D ZEND_DEBUG=1 /D WIN32 /D NDEBUG /D 
_WINDOWS /D COMPILE_DL_FRIBIDI /D ZTS=1 /D ZEND_WIN32 /D PHP_WIN32 /D 
HAVE_FRIBIDI=1 /D PHP_FRIBIDI_EXPORTS /YX /FD /GZ /c
# ADD BASE MTL /nologo /D _DEBUG /mktyplib203 /win32
# ADD MTL /nologo /D _DEBUG /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d _DEBUG
# ADD RSC /l 0x407 /d _DEBUG
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 
/nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 php4ts_debug.lib fribidi.lib kernel32.lib user32.lib gdi32.lib 
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 
/out:..\..\Debug_TS/php_fribidi.dll /pdbtype:sept /libpath:..\..\Debug_TS 
/libpath:..\..\..\php_build\release

!ENDIF 

# Begin Target

# Name fribidi - Win32 Release_TS
# Name fribidi - Win32 Debug_TS
# Begin Group Source Files

# PROP Default_Filter cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
# Begin Source File

SOURCE=.\fribidi.c
# End Source File
# End Group
# Begin Group Header Files

# PROP Default_Filter h;hpp;hxx;hm;inl
# Begin Source File

SOURCE=.\php_fribidi.h
# End Source File
# End Group
# End Target
# End Project



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




[PHP-CVS] cvs: php4 /ext/snmp snmp.c

2002-10-15 Thread Jani Taskinen

sniper  Tue Oct 15 20:29:56 2002 EDT

  Modified files:  
/php4/ext/snmp  snmp.c 
  Log:
  - Fix the last commit..(thanks to Harrie Hazewinkel [EMAIL PROTECTED])
  
  
Index: php4/ext/snmp/snmp.c
diff -u php4/ext/snmp/snmp.c:1.62 php4/ext/snmp/snmp.c:1.63
--- php4/ext/snmp/snmp.c:1.62   Mon Oct 14 20:43:34 2002
+++ php4/ext/snmp/snmp.cTue Oct 15 20:29:56 2002
@@ -17,7 +17,7 @@
 |  Steven Lawrance [EMAIL PROTECTED]|
 +--+
 */
-/* $Id: snmp.c,v 1.62 2002/10/15 00:43:34 sniper Exp $ */
+/* $Id: snmp.c,v 1.63 2002/10/16 00:29:56 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -338,7 +338,7 @@
 
if (st != 11) {
 #ifdef HAVE_NET_SNMP
-   snprint_value(buf, strlen(buf), 
vars-name, vars-name_length, vars);
+   snprint_value(buf, sizeof(buf), 
+vars-name, vars-name_length, vars);
 #else
sprint_value((struct sbuf *) 
buf,vars-name, vars-name_length, vars);
 #endif
@@ -350,7 +350,7 @@

add_next_index_string(return_value,buf,1); /* Add to returned array */
} else if (st == 3)  {
 #ifdef HAVE_NET_SNMP
-   snprint_objid(buf2, strlen(buf2), 
vars-name, vars-name_length);
+   snprint_objid(buf2, sizeof(buf2), 
+vars-name, vars-name_length);
 #else
sprint_objid((struct sbuf *)buf2, 
vars-name, vars-name_length);
 #endif
@@ -373,7 +373,7 @@
vars = vars-next_variable, count++);
if (vars) {
 #ifdef HAVE_NET_SNMP
-   snprint_objid(buf, 
strlen(buf), vars-name, vars-name_length);
+   snprint_objid(buf, 
+sizeof(buf), vars-name, vars-name_length);
 #else
sprint_objid((struct sbuf 
*)buf,vars-name, vars-name_length);
 #endif



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




[PHP-CVS] cvs: php4 /ext/snmp snmp.c

2002-10-15 Thread Jani Taskinen

sniper  Tue Oct 15 22:33:47 2002 EDT

  Modified files:  
/php4/ext/snmp  snmp.c 
  Log:
  - Fixed memleak when connection fails.
  - Fixed snmpget() to work with net-snmp
  - Fixed the error messages to use the new style.
  
  
Index: php4/ext/snmp/snmp.c
diff -u php4/ext/snmp/snmp.c:1.64 php4/ext/snmp/snmp.c:1.65
--- php4/ext/snmp/snmp.c:1.64   Tue Oct 15 20:58:15 2002
+++ php4/ext/snmp/snmp.cTue Oct 15 22:33:47 2002
@@ -17,7 +17,7 @@
 |  Steven Lawrance [EMAIL PROTECTED]|
 +--+
 */
-/* $Id: snmp.c,v 1.64 2002/10/16 00:58:15 sniper Exp $ */
+/* $Id: snmp.c,v 1.65 2002/10/16 02:33:47 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -189,7 +189,7 @@
 char *value = (char *) 0;
char hostname[MAX_NAME_LEN];
int remote_port = 161;
-   char *pptr;
+   char *pptr, *err;
 
if (myargc  3 || myargc  7 ||
zend_get_parameters_ex(myargc, a1, a2, a3, a4, a5, a6, a7) == 
FAILURE) {
@@ -240,7 +240,7 @@
if (read_objid(objid, root, rootlen)) {
gotroot = 1;
} else {
-   php_error(E_WARNING,Invalid object identifier: %s\n, 
objid);
+   php_error(E_WARNING,Invalid object identifier: %s, 
+objid);
}
}
 
@@ -283,7 +283,9 @@
 #endif
 
if ((ss = snmp_open(session)) == NULL) {
-   php_error(E_WARNING,Could not open snmp\n);
+   snmp_error(session, NULL, NULL, err);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Could not open snmp 
+connection: %s, err);
+   free(err);
RETURN_FALSE;
}
 
@@ -293,11 +295,7 @@
switch(st) {
case 2:
case 3:
-   if (array_init(return_value) == FAILURE) {
-   php_error(E_WARNING, Cannot prepare result 
array);
-   snmp_close(ss);
-   RETURN_FALSE;
-   }
+   array_init(return_value);
break;
default:
RETVAL_TRUE;
@@ -309,9 +307,9 @@
keepwalking = 0;
if (st == 1) {
pdu = snmp_pdu_create(SNMP_MSG_GET);
-   name_length = MAX_NAME_LEN;
-   if (!read_objid(objid, name, name_length)) {
-   php_error(E_WARNING,Invalid object identifier: %s\n, 
objid);
+   name_length = MAX_OID_LEN;
+   if (!snmp_parse_oid(objid, name, name_length)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
+object identifier: %s, objid);
snmp_close(ss);
RETURN_FALSE;
}
@@ -319,7 +317,7 @@
} else if (st == 11) {
pdu = snmp_pdu_create(SNMP_MSG_SET);
if (snmp_add_var(pdu, name, name_length, type, value)) {
-   php_error(E_WARNING,Could not add variable: %s\n, 
name);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Could not 
+add variable: %s, name);
snmp_close(ss);
RETURN_FALSE;
}
@@ -369,7 +367,7 @@
}   
} else {
if (st != 2 || response-errstat != 
SNMP_ERR_NOSUCHNAME) {
-   php_error(E_WARNING,Error in packet.\nReason: 
%s\n, snmp_errstring(response-errstat));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
+Error in packet: %s, snmp_errstring(response-errstat));
if (response-errstat == SNMP_ERR_NOSUCHNAME) {
for (count=1, vars = 
response-variables; vars  count != response-errindex;
vars = vars-next_variable, count++);
@@ -380,7 +378,7 @@
sprint_objid((struct sbuf 
*)buf,vars-name, vars-name_length);
 #endif
}
-   php_error(E_WARNING,This name does 
not exist: %s\n,buf);
+   php_error_docref(NULL TSRMLS_CC, 
+E_WARNING, This name does not exist: %s,buf);
}
if (st == 1) {