[PHP-CVS] cvs: php-src /ext/standard/tests/file bug38086.phpt bug38086.txt stream_copy_to_stream.phpt /main/streams streams.c
tony2001Thu Jul 13 11:58:42 2006 UTC Added files: /php-src/ext/standard/tests/filebug38086.phpt bug38086.txt stream_copy_to_stream.phpt Modified files: /php-src/main/streams streams.c Log: fix #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length) http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.127&r2=1.128&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.127 php-src/main/streams/streams.c:1.128 --- php-src/main/streams/streams.c:1.127Wed Jun 21 20:17:21 2006 +++ php-src/main/streams/streams.c Thu Jul 13 11:58:42 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.127 2006/06/21 20:17:21 andrei Exp $ */ +/* $Id: streams.c,v 1.128 2006/07/13 11:58:42 tony2001 Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -1810,11 +1810,7 @@ writeptr += didwrite; } } else { - if (maxlen == 0) { - return haveread; - } else { - return 0; /* error */ - } + return haveread; } if (maxlen - haveread == 0) { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug38086.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug38086.phpt +++ php-src/ext/standard/tests/file/bug38086.phpt --TEST-- Bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length) --FILE-- --EXPECTF-- int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug38086.txt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug38086.txt +++ php-src/ext/standard/tests/file/bug38086.txt Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stream_copy_to_stream.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/stream_copy_to_stream.phpt +++ php-src/ext/standard/tests/file/stream_copy_to_stream.phpt --TEST-- stream_copy_to_stream() tests --FILE-- --EXPECTF-- int(0) string(0) "" int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " int(134) string(134) "Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell " int(134) string(134) "Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell " int(10) string(10) "Another da" int(134) string(134) "Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell " 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/tests/file bug38086.phpt bug38086.txt stream_copy_to_stream.phpt /main/streams streams.c
tony2001Thu Jul 13 12:00:17 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/filebug38086.phpt bug38086.txt stream_copy_to_stream.phpt Modified files: /php-srcNEWS /php-src/main/streams streams.c Log: MFH: fix #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length) add tests http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.119&r2=1.2027.2.547.2.120&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.119 php-src/NEWS:1.2027.2.547.2.120 --- php-src/NEWS:1.2027.2.547.2.119 Wed Jul 12 09:51:47 2006 +++ php-src/NEWSThu Jul 13 12:00:16 2006 @@ -82,6 +82,8 @@ - Fixed memory leaks in openssl streams context options. (Pierre) - Fixed handling of extremely long paths inside tempnam() function. (Ilia) +- Fixed bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger + than the actual length). (Tony) - Fixed bug #38072 (boolean arg for mysqli_autocommit() is always true on Solaris). (Tony) - Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.3&r2=1.82.2.6.2.4&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.3 php-src/main/streams/streams.c:1.82.2.6.2.4 --- php-src/main/streams/streams.c:1.82.2.6.2.3 Tue Jun 20 18:09:50 2006 +++ php-src/main/streams/streams.c Thu Jul 13 12:00:17 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.82.2.6.2.3 2006/06/20 18:09:50 bjori Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.4 2006/07/13 12:00:17 tony2001 Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -1348,11 +1348,7 @@ writeptr += didwrite; } } else { - if (maxlen == 0) { - return haveread; - } else { - return 0; /* error */ - } + return haveread; } if (maxlen - haveread == 0) { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug38086.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug38086.phpt +++ php-src/ext/standard/tests/file/bug38086.phpt --TEST-- Bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length) --FILE-- --EXPECTF-- int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug38086.txt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug38086.txt +++ php-src/ext/standard/tests/file/bug38086.txt Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/stream_copy_to_stream.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/stream_copy_to_stream.phpt +++ php-src/ext/standard/tests/file/stream_copy_to_stream.phpt --TEST-- stream_copy_to_stream() tests --FILE-- --EXPECTF-- int(0) string(0) "" int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " int(134) string(134) "Nabgure qnl Jura gur cnvaf bs yvsr jba'g one zl jnl V'yy oernx gurfr punvaf Gung ubyq zr qbja V'yy grne lbh qbja vagb zl cevingr uryy " int(134) string(134) "Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell " int(134) string(134) "Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell " int(10) string(10) "Another da" int(134) string(134) "Another day When the pains of life won't bar my way I'll break these chains That hold me down I'll tear you down into my private hell " Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/unicode transform.c
tony2001Thu Jul 13 12:15:01 2006 UTC Modified files: /php-src/ext/unicodetransform.c Log: nuke unused variable http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/transform.c?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/unicode/transform.c diff -u php-src/ext/unicode/transform.c:1.3 php-src/ext/unicode/transform.c:1.4 --- php-src/ext/unicode/transform.c:1.3 Thu Jun 15 17:37:48 2006 +++ php-src/ext/unicode/transform.c Thu Jul 13 12:15:01 2006 @@ -14,7 +14,7 @@ +--+ */ -/* $Id: transform.c,v 1.3 2006/06/15 17:37:48 andrei Exp $ */ +/* $Id: transform.c,v 1.4 2006/07/13 12:15:01 tony2001 Exp $ */ #include "php_unicode.h" @@ -28,7 +28,7 @@ int result_len = 0; UTransliterator *trans = NULL; UErrorCode status = U_ZERO_ERROR; - int32_t capacity, start, limit; + int32_t capacity, limit; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "uuu|u", &str, &str_len, &from, &from_len, &to, &to_len, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main rfc1867.c
tony2001Thu Jul 13 12:17:26 2006 UTC Modified files: /php-src/main rfc1867.c Log: fix C++ comments in C code and comment out unused variable http://cvs.php.net/viewvc.cgi/php-src/main/rfc1867.c?r1=1.185&r2=1.186&diff_format=u Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.185 php-src/main/rfc1867.c:1.186 --- php-src/main/rfc1867.c:1.185Wed Mar 8 00:43:29 2006 +++ php-src/main/rfc1867.c Thu Jul 13 12:17:25 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: rfc1867.c,v 1.185 2006/03/08 00:43:29 pajoye Exp $ */ +/* $Id: rfc1867.c,v 1.186 2006/07/13 12:17:25 tony2001 Exp $ */ /* * This product includes software developed by the Apache Group @@ -1145,7 +1145,7 @@ UErrorCode status = U_ZERO_ERROR; char *value = multipart_buffer_read_body(mbuff TSRMLS_CC); - unsigned int new_val_len; /* Dummy variable */ + /* unsigned int new_val_len; Dummy variable */ if (value) { /* UTODO use 'charset' parameter for conversion */ @@ -1159,9 +1159,9 @@ } /* UTODO use input filtering */ - //if (sapi_module.input_filter(PARSE_POST, param, &value, strlen(value), &new_val_len TSRMLS_CC)) { + /* if (sapi_module.input_filter(PARSE_POST, param, &value, strlen(value), &new_val_len TSRMLS_CC)) { */ safe_u_php_register_variable(param, u_val, u_val_len, array_ptr, 0 TSRMLS_CC); - //} + /* } */ if (!u_strcasecmp(param, maxfilesize_key, 0)) { max_file_size = zend_u_strtol(u_val, NULL, 10); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
tony2001Thu Jul 13 12:34:30 2006 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: Unicode support in ReflectionParameter::__construct() http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.242&r2=1.243&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.242 php-src/ext/reflection/php_reflection.c:1.243 --- php-src/ext/reflection/php_reflection.c:1.242 Mon Jul 10 00:13:50 2006 +++ php-src/ext/reflection/php_reflection.c Thu Jul 13 12:34:30 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.242 2006/07/10 00:13:50 helly Exp $ */ +/* $Id: php_reflection.c,v 1.243 2006/07/13 12:34:30 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1866,10 +1866,12 @@ zend_uint i; position= -1; - convert_to_string_ex(¶meter); + convert_to_text_ex(¶meter); for (i = 0; i < fptr->common.num_args; i++) { - /* FIXME: Unicode support??? */ - if (arg_info[i].name.s && strcmp(arg_info[i].name.s, Z_STRVAL_P(parameter)) == 0) { + if (Z_TYPE_P(parameter) == IS_STRING && arg_info[i].name.s && strcmp(arg_info[i].name.s, Z_STRVAL_P(parameter)) == 0) { + position= i; + break; + } else if (Z_TYPE_P(parameter) == IS_UNICODE && arg_info[i].name.u && u_strcmp(arg_info[i].name.u, Z_USTRVAL_P(parameter)) == 0) { position= i; break; } @@ -4836,7 +4838,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.242 2006/07/10 00:13:50 helly Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.243 2006/07/13 12:34:30 tony2001 Exp $"); 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) /main php_logos.c
iliaa Thu Jul 13 15:05:30 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main php_logos.c Log: Fixed compiler warnings. http://cvs.php.net/viewvc.cgi/php-src/main/php_logos.c?r1=1.19.2.1&r2=1.19.2.1.2.1&diff_format=u Index: php-src/main/php_logos.c diff -u php-src/main/php_logos.c:1.19.2.1 php-src/main/php_logos.c:1.19.2.1.2.1 --- php-src/main/php_logos.c:1.19.2.1 Sun Jan 1 12:50:17 2006 +++ php-src/main/php_logos.cThu Jul 13 15:05:30 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_logos.c,v 1.19.2.1 2006/01/01 12:50:17 sniper Exp $ */ +/* $Id: php_logos.c,v 1.19.2.1.2.1 2006/07/13 15:05:30 iliaa Exp $ */ #include "php.h" #include "logos.h" @@ -27,13 +27,13 @@ typedef struct _php_info_logo { char *mimetype; int mimelen; - unsigned char *data; + const unsigned char *data; int size; } php_info_logo; HashTable phpinfo_logo_hash; -PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size) +PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, const unsigned char *data, int size) { php_info_logo info_logo; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main php_logos.c
iliaa Thu Jul 13 15:05:42 2006 UTC Modified files: /php-src/main php_logos.c Log: MFB: Fixed compiler warnings. http://cvs.php.net/viewvc.cgi/php-src/main/php_logos.c?r1=1.21&r2=1.22&diff_format=u Index: php-src/main/php_logos.c diff -u php-src/main/php_logos.c:1.21 php-src/main/php_logos.c:1.22 --- php-src/main/php_logos.c:1.21 Thu Mar 2 13:12:45 2006 +++ php-src/main/php_logos.cThu Jul 13 15:05:42 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_logos.c,v 1.21 2006/03/02 13:12:45 dmitry Exp $ */ +/* $Id: php_logos.c,v 1.22 2006/07/13 15:05:42 iliaa Exp $ */ #include "php.h" #include "logos.h" @@ -27,13 +27,13 @@ typedef struct _php_info_logo { char *mimetype; int mimelen; - unsigned char *data; + const unsigned char *data; int size; } php_info_logo; HashTable phpinfo_logo_hash; -PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size) +PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, const unsigned char *data, int size) { php_info_logo info_logo; -- 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/mysqli/tests bug36802.phpt
iliaa Thu Jul 13 15:42:43 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mysqli/tests bug36802.phpt Log: Fixed test for systems where set_charset() method is unavailable. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug36802.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u Index: php-src/ext/mysqli/tests/bug36802.phpt diff -u php-src/ext/mysqli/tests/bug36802.phpt:1.1.2.1 php-src/ext/mysqli/tests/bug36802.phpt:1.1.2.1.2.1 --- php-src/ext/mysqli/tests/bug36802.phpt:1.1.2.1 Fri Mar 24 09:32:24 2006 +++ php-src/ext/mysqli/tests/bug36802.phpt Thu Jul 13 15:42:43 2006 @@ -17,7 +17,11 @@ $mysql = mysqli_init(); /* following operations should not work */ - $x[0] = @$mysql->set_charset('utf8'); + if (method_exists($mysql, 'set_charset')) { + $x[0] = @$mysql->set_charset('utf8'); + } else { + $x[0] = NULL; + } $x[1] = @$mysql->query("SELECT 'foo' FROM DUAL"); /* following operations should work */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqli/tests bug36802.phpt
iliaa Thu Jul 13 15:42:55 2006 UTC Modified files: /php-src/ext/mysqli/tests bug36802.phpt Log: MFB: Fixed test for systems where set_charset() method is unavailable. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug36802.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/mysqli/tests/bug36802.phpt diff -u php-src/ext/mysqli/tests/bug36802.phpt:1.2 php-src/ext/mysqli/tests/bug36802.phpt:1.3 --- php-src/ext/mysqli/tests/bug36802.phpt:1.2 Tue May 9 13:53:39 2006 +++ php-src/ext/mysqli/tests/bug36802.phpt Thu Jul 13 15:42:55 2006 @@ -17,7 +17,11 @@ $mysql = mysqli_init(); /* following operations should not work */ - $x[0] = @$mysql->set_charset('utf8'); + if (method_exists($mysql, 'set_charset')) { + $x[0] = @$mysql->set_charset('utf8'); + } else { + $x[0] = NULL; + } $x[1] = @$mysql->query("SELECT 'foo' FROM DUAL"); /* following operations should work */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main php_logos.h
tony2001Thu Jul 13 17:02:43 2006 UTC Modified files: /php-src/main php_logos.h Log: fix build http://cvs.php.net/viewvc.cgi/php-src/main/php_logos.h?r1=1.10&r2=1.11&diff_format=u Index: php-src/main/php_logos.h diff -u php-src/main/php_logos.h:1.10 php-src/main/php_logos.h:1.11 --- php-src/main/php_logos.h:1.10 Sun Jan 1 13:09:57 2006 +++ php-src/main/php_logos.hThu Jul 13 17:02:43 2006 @@ -16,14 +16,14 @@ +--+ */ -/* $Id: php_logos.h,v 1.10 2006/01/01 13:09:57 sniper Exp $ */ +/* $Id: php_logos.h,v 1.11 2006/07/13 17:02:43 tony2001 Exp $ */ #ifndef _PHP_LOGOS_H #define _PHP_LOGOS_H BEGIN_EXTERN_C() -PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size); +PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, const unsigned char *data, int size); PHPAPI int php_unregister_info_logo(char *logo_string); END_EXTERN_C() -- 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_logos.h
tony2001Thu Jul 13 17:03:36 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main php_logos.h Log: fix build http://cvs.php.net/viewvc.cgi/php-src/main/php_logos.h?r1=1.9.2.1&r2=1.9.2.1.2.1&diff_format=u Index: php-src/main/php_logos.h diff -u php-src/main/php_logos.h:1.9.2.1 php-src/main/php_logos.h:1.9.2.1.2.1 --- php-src/main/php_logos.h:1.9.2.1Sun Jan 1 12:50:17 2006 +++ php-src/main/php_logos.hThu Jul 13 17:03:35 2006 @@ -16,14 +16,14 @@ +--+ */ -/* $Id: php_logos.h,v 1.9.2.1 2006/01/01 12:50:17 sniper Exp $ */ +/* $Id: php_logos.h,v 1.9.2.1.2.1 2006/07/13 17:03:35 tony2001 Exp $ */ #ifndef _PHP_LOGOS_H #define _PHP_LOGOS_H BEGIN_EXTERN_C() -PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size); +PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, const unsigned char *data, int size); PHPAPI int php_unregister_info_logo(char *logo_string); END_EXTERN_C() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard string.c /main main.c
tony2001Thu Jul 13 17:55:50 2006 UTC Modified files: /php-src/main main.c /php-src/ext/standard string.c Log: initialize variables http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.695&r2=1.696&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.695 php-src/main/main.c:1.696 --- php-src/main/main.c:1.695 Wed Jul 12 17:04:13 2006 +++ php-src/main/main.c Thu Jul 13 17:55:50 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.695 2006/07/12 17:04:13 andrei Exp $ */ +/* $Id: main.c,v 1.696 2006/07/13 17:55:50 tony2001 Exp $ */ /* {{{ includes */ @@ -534,7 +534,7 @@ zstr function = NULL_ZSTR; char *origin; char *message; - char *stage; + char *stage = "Unknown"; int function_name_is_string = 1; /* get error text into buffer and escape for html if necessary */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.548&r2=1.549&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.548 php-src/ext/standard/string.c:1.549 --- php-src/ext/standard/string.c:1.548 Wed Jul 12 12:33:04 2006 +++ php-src/ext/standard/string.c Thu Jul 13 17:55:50 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.548 2006/07/12 12:33:04 tony2001 Exp $ */ +/* $Id: string.c,v 1.549 2006/07/13 17:55:50 tony2001 Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1326,7 +1326,7 @@ UChar *u_token, *u_p, *u_pe; UChar32 ch, th; - int32_t start, end, i, j, rem_len; + int32_t start = 0, end, i, j, rem_len; int delim_found, token_present; int skipped = 0; @@ -2111,7 +2111,7 @@ char needle_char[2]; UChar u_needle_char[3]; int needle_len; - char *haystack_copy; + char *haystack_copy = NULL; zstr target; void *found = NULL; int found_offset; @@ -2411,9 +2411,9 @@ zend_uchar str_type; void *haystack_dup, *needle_dup = NULL; char needle_char[2]; - char c; + char c = 0; UChar u_needle_char[3]; - UChar32 ch; + UChar32 ch = 0; void *found = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &haystack, &needle, &offset) == FAILURE) { @@ -3908,10 +3908,10 @@ PHP_FUNCTION(strrev) { zval **str; - char *s, *e, *n, *p; + char *s, *e, *n = NULL, *p; int32_t i, x1, x2; UChar32 ch; - UChar *u_s, *u_n, *u_p; + UChar *u_s, *u_n = NULL, *u_p; if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &str) == FAILURE) { WRONG_PARAM_COUNT; @@ -6316,7 +6316,7 @@ int ac = ZEND_NUM_ARGS(); int count = 0; void *p, *endp, *tmp; - int32_t i, j; + int32_t i = 0, j; char cmp; if (zend_parse_parameters(ac TSRMLS_CC, "TT|ll", @@ -6798,7 +6798,7 @@ if (haystack_type == IS_UNICODE) { int32_t i, j; - UChar32 ch1, ch2; + UChar32 ch1, ch2 = 0; for (i = 0 ; i < haystack_len ; ) { U16_NEXT((UChar *)haystack, i, haystack_len, ch1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard array.c
andrei Thu Jul 13 21:08:43 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard array.c Log: - Make compact() normalize variablem name before checking symtable. - Mark tested/upgraded functions with 'U' flag. http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.12&r2=1.13&diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.12 php-src/unicode-progress.txt:1.13 --- php-src/unicode-progress.txt:1.12 Wed Jul 12 23:17:07 2006 +++ php-src/unicode-progress.txtThu Jul 13 21:08:43 2006 @@ -13,9 +13,6 @@ array_change_key_case() Params API, test -array_chunk() -Test - array_combine() Handle IS_UNICODE/IS_STRING keys via add_u_assoc_zval() @@ -106,12 +103,6 @@ extract() Params API, fix php_valid_var_name(), test -compact() -Test - -min(), max() -Test - natsort(), natcasesort() Params API Either port strnatcmp() to support Unicode or maybe use ICU's numeric collation @@ -134,7 +125,11 @@ array.c --- +array_chunk() +compact() count() +min() +max() string.c http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.350&r2=1.351&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.350 php-src/ext/standard/array.c:1.351 --- php-src/ext/standard/array.c:1.350 Sun Jun 25 19:19:31 2006 +++ php-src/ext/standard/array.cThu Jul 13 21:08:43 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.350 2006/06/25 19:19:31 bjori Exp $ */ +/* $Id: array.c,v 1.351 2006/07/13 21:08:43 andrei Exp $ */ #include "php.h" #include "php_ini.h" @@ -291,14 +291,14 @@ return cnt; } -/* {{{ proto int count(mixed var [, int mode]) +/* {{{ proto int count(mixed var [, int mode]) U Count the number of elements in a variable (usually an array) */ PHP_FUNCTION(count) { zval *array; long mode = COUNT_NORMAL; - if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &array, &mode) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &array, &mode) == FAILURE) return; switch (Z_TYPE_P(array)) { @@ -955,7 +955,7 @@ } /* }}} */ -/* {{{ proto mixed min(mixed arg1 [, mixed arg2 [, mixed ...]]) +/* {{{ proto mixed min(mixed arg1 [, mixed arg2 [, mixed ...]]) U Return the lowest value in an array or a series of arguments */ PHP_FUNCTION(min) { @@ -1005,7 +1005,7 @@ } /* }}} */ -/* {{{ proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]]) +/* {{{ proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]]) U Return the highest value in an array or a series of arguments */ PHP_FUNCTION(max) { @@ -1567,20 +1567,41 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry) { + zstr key; + int key_len; + zend_bool free_key = 0; zval **value_ptr, *value, *data; - - if (Z_TYPE_P(entry) == IS_STRING || - Z_TYPE_P(entry) == IS_UNICODE) { - if (zend_u_hash_find(eg_active_symbol_table, Z_TYPE_P(entry), Z_UNIVAL_P(entry), - Z_UNILEN_P(entry)+1, (void **)&value_ptr) != FAILURE) { + + if (Z_TYPE_P(entry) == IS_STRING || Z_TYPE_P(entry) == IS_UNICODE) { + key = Z_UNIVAL_P(entry); + key_len = Z_UNILEN_P(entry); + + if (Z_TYPE_P(entry) == IS_UNICODE) { + /* Identifier normalization */ + UChar *norm; + int norm_len; + + if (!zend_normalize_identifier(&norm, &norm_len, key.u, key_len, 0)) { + zend_error(E_WARNING, "Could not normalize variable name: %r", key); + } else if (norm != key.u) { + key.u = norm; + key_len = norm_len; + free_key = 1; + } + } + if (zend_u_hash_find(eg_active_symbol_table, Z_TYPE_P(entry), key, +key_len+1, (void **)&value_ptr) != FAILURE) { value = *value_ptr; ALLOC_ZVAL(data); *data = *value; zval_copy_ctor(data); INIT_PZVAL(data); - zend_u_hash_update(Z_ARRVAL_P(return_value), Z_TYPE_P(entry), Z_UNIVAL_P(entry), -Z_UNILEN_P(entry)+1, &data, sizeof(zval *), NULL); + zend_u_hash_update(Z_ARRVAL_P(return_value), Z_TYPE_P(entry), key, +
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard array.c
andrei Thu Jul 13 22:03:43 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard array.c Log: Mark a few more funcs. http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.14&r2=1.15&diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.14 php-src/unicode-progress.txt:1.15 --- php-src/unicode-progress.txt:1.14 Thu Jul 13 21:27:48 2006 +++ php-src/unicode-progress.txtThu Jul 13 22:03:42 2006 @@ -104,11 +104,8 @@ Params API Either port strnatcmp() to support Unicode or maybe use ICU's numeric collation -sort(), rsort() -asort(), arsort() -ksort(), krsort() usort(), uasort(), uksort() -Test, make sure SORT_LOCALE_STRING uses default collator +function name normalization, FCI cache Completed @@ -126,6 +123,10 @@ range() shuffle() +sort(), rsort() +asort(), arsort() +ksort(), krsort() + string.c http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.352&r2=1.353&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.352 php-src/ext/standard/array.c:1.353 --- php-src/ext/standard/array.c:1.352 Thu Jul 13 21:27:48 2006 +++ php-src/ext/standard/array.cThu Jul 13 22:03:42 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.352 2006/07/13 21:27:48 andrei Exp $ */ +/* $Id: array.c,v 1.353 2006/07/13 22:03:42 andrei Exp $ */ #include "php.h" #include "php_ini.h" @@ -225,7 +225,7 @@ return array_key_compare(a, b TSRMLS_CC) * -1; } -/* {{{ proto bool krsort(array &array_arg [, int sort_flags]) +/* {{{ proto bool krsort(array &array_arg [, int sort_flags]) U Sort an array by key value in reverse order */ PHP_FUNCTION(krsort) { @@ -247,7 +247,7 @@ } /* }}} */ -/* {{{ proto bool ksort(array &array_arg [, int sort_flags]) +/* {{{ proto bool ksort(array &array_arg [, int sort_flags]) U Sort an array by key */ PHP_FUNCTION(ksort) { @@ -478,7 +478,7 @@ /* }}} */ -/* {{{ proto bool asort(array &array_arg [, int sort_flags]) +/* {{{ proto bool asort(array &array_arg [, int sort_flags]) U Sort an array and maintain index association */ PHP_FUNCTION(asort) { @@ -500,7 +500,7 @@ } /* }}} */ -/* {{{ proto bool arsort(array &array_arg [, int sort_flags]) +/* {{{ proto bool arsort(array &array_arg [, int sort_flags]) U Sort an array in reverse order and maintain index association */ PHP_FUNCTION(arsort) { @@ -522,7 +522,7 @@ } /* }}} */ -/* {{{ proto bool sort(array &array_arg [, int sort_flags]) +/* {{{ proto bool sort(array &array_arg [, int sort_flags]) U Sort an array */ PHP_FUNCTION(sort) { @@ -544,7 +544,7 @@ } /* }}} */ -/* {{{ proto bool rsort(array &array_arg [, int sort_flags]) +/* {{{ proto bool rsort(array &array_arg [, int sort_flags]) U Sort an array in reverse order */ PHP_FUNCTION(rsort) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard array.c
andrei Thu Jul 13 22:26:43 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard array.c Log: Update array_sum() and array_product() (U). http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.15&r2=1.16&diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.15 php-src/unicode-progress.txt:1.16 --- php-src/unicode-progress.txt:1.15 Thu Jul 13 22:03:42 2006 +++ php-src/unicode-progress.txtThu Jul 13 22:26:42 2006 @@ -55,9 +55,6 @@ array_pad() Params API, test -array_product() -Params API, test - array_push(), array_pop(), array_shift(), array_unshift() Params API, test @@ -79,9 +76,6 @@ array_slice() Params API, test -array_sum() -Params API, test - array_unique() Params API, test @@ -105,7 +99,7 @@ Either port strnatcmp() to support Unicode or maybe use ICU's numeric collation usort(), uasort(), uksort() -function name normalization, FCI cache +Params API, callback name normalization, FCI cache Completed @@ -116,6 +110,8 @@ array_chunk() array_merge() array_merge_recursive() +array_product() +array_sum() compact() count() min() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.353&r2=1.354&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.353 php-src/ext/standard/array.c:1.354 --- php-src/ext/standard/array.c:1.353 Thu Jul 13 22:03:42 2006 +++ php-src/ext/standard/array.cThu Jul 13 22:26:42 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.353 2006/07/13 22:03:42 andrei Exp $ */ +/* $Id: array.c,v 1.354 2006/07/13 22:26:42 andrei Exp $ */ #include "php.h" #include "php_ini.h" @@ -4142,31 +4142,25 @@ } /* }}} */ -/* {{{ proto mixed array_sum(array input) +/* {{{ proto mixed array_sum(array input) U Returns the sum of the array entries */ PHP_FUNCTION(array_sum) { - zval **input, + zval *input, **entry, entry_n; - int argc = ZEND_NUM_ARGS(); HashPosition pos; double dval; - if (argc != 1 || zend_get_parameters_ex(argc, &input) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { return; } ZVAL_LONG(return_value, 0); - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(input), &pos); -zend_hash_get_current_data_ex(Z_ARRVAL_PP(input), (void **)&entry, &pos) == SUCCESS; -zend_hash_move_forward_ex(Z_ARRVAL_PP(input), &pos)) { + for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(input), &pos); +zend_hash_get_current_data_ex(Z_ARRVAL_P(input), (void **)&entry, &pos) == SUCCESS; +zend_hash_move_forward_ex(Z_ARRVAL_P(input), &pos)) { if (Z_TYPE_PP(entry) == IS_ARRAY || Z_TYPE_PP(entry) == IS_OBJECT) continue; @@ -4189,34 +4183,28 @@ } /* }}} */ -/* {{{ proto mixed array_product(array input) +/* {{{ proto mixed array_product(array input) U Returns the product of the array entries */ PHP_FUNCTION(array_product) { - zval **input, + zval *input, **entry, entry_n; - int argc = ZEND_NUM_ARGS(); HashPosition pos; double dval; - if (argc != 1 || zend_get_parameters_ex(argc, &input) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) { return; } - if (!zend_hash_num_elements(Z_ARRVAL_PP(input))) { + if (!zend_hash_num_elements(Z_ARRVAL_P(input))) { RETURN_LONG(0); } ZVAL_LONG(return_value, 1); - for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(input), &pos); -zend_hash_get_current_data_ex(Z_ARRVAL_PP(input), (void **)&entry, &pos) == SUCCESS; -zend_hash_move_forward_ex(Z_ARRVAL_PP(input), &pos)) { + for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(input), &pos); +zend_hash_get_current_data_ex(Z_ARRVAL_P(input), (void **)&entry, &pos) == SUCCESS; +zend_hash_move_forward_ex(Z_ARRVAL_P(input), &pos)) { if (Z_TYPE_PP(entry) == IS_ARRAY || Z_TYPE_PP(entry) == IS_OBJECT)
[PHP-CVS] cvs: php-src /ext/standard string.c
andrei Thu Jul 13 22:26:50 2006 UTC Modified files: /php-src/ext/standard string.c Log: FIXME note http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.550&r2=1.551&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.550 php-src/ext/standard/string.c:1.551 --- php-src/ext/standard/string.c:1.550 Thu Jul 13 21:27:48 2006 +++ php-src/ext/standard/string.c Thu Jul 13 22:26:50 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.550 2006/07/13 21:27:48 andrei Exp $ */ +/* $Id: string.c,v 1.551 2006/07/13 22:26:50 andrei Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -4065,6 +4065,7 @@ sum += php_u_similar_char(txt1, pos1, txt2, pos2); } if ((pos1 + end1 < len1) && (pos2 + end2 < len2)) { + /* FIXME should this be calling php_u_similar_char? */ sum += php_similar_char((UChar *)txt1+pos1+end1, len1-pos1-end1, (UChar *)txt2+pos2+end2, len2-pos2-end2); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php