helly Fri Apr 6 21:07:48 2007 UTC Modified files: /php-src/ext/spl php_spl.c Log: - Fix unicode issue in unregister according to register solution http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.112&r2=1.113&diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.112 php-src/ext/spl/php_spl.c:1.113 --- php-src/ext/spl/php_spl.c:1.112 Fri Apr 6 21:02:20 2007 +++ php-src/ext/spl/php_spl.c Fri Apr 6 21:07:48 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_spl.c,v 1.112 2007/04/06 21:02:20 helly Exp $ */ +/* $Id: php_spl.c,v 1.113 2007/04/06 21:07:48 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -474,7 +474,7 @@ if (Z_TYPE(zfunc_name) == IS_UNICODE) { func_name_len /= sizeof(UChar); Z_STRLEN(zfunc_name) = func_name_len; - lc_name.u[func_name_len] = '\0'; + lc_name.u[func_name_len] = 0; } else { Z_STRLEN(zfunc_name) = func_name_len; lc_name.s[func_name_len] = '\0'; @@ -548,12 +548,14 @@ success = zend_u_hash_del(SPL_G(autoload_functions), Z_TYPE(zfunc_name), lc_name, Z_UNILEN(zfunc_name)+1); if (success != SUCCESS && obj_ptr) { size_t func_name_len = Z_UNISIZE(zfunc_name); - lc_name.v = erealloc(lc_name.v, func_name_len + 1 + sizeof(zend_object_handle)); + lc_name.v = erealloc(lc_name.v, func_name_len + 2 + sizeof(zend_object_handle)); memcpy(lc_name.v + func_name_len, &Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); func_name_len += sizeof(zend_object_handle); - lc_name.s[func_name_len] = '\0'; if (Z_TYPE(zfunc_name) == IS_UNICODE) { func_name_len /= sizeof(UChar); + lc_name.u[func_name_len] = 0; + } else { + lc_name.s[func_name_len] = '\0'; } success = zend_u_hash_del(SPL_G(autoload_functions), Z_TYPE(zfunc_name), lc_name, func_name_len+1); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php