cvs: ZendEngine2 / zend.c zend_globals.h zend_unicode.c

From: Date: Fri, 29 Sep 2006 20:59:26 +0000
Subject: cvs: ZendEngine2 / zend.c zend_globals.h zend_unicode.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5283@lists.php.net to get a copy of this message
andrei Fri Sep 29 20:59:26 2006 UTC Modified files: /ZendEngine2 zend.c zend_globals.h zend_unicode.c Log: Fix off-by-one error. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.372&r2=1.373&diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.372 ZendEngine2/zend.c:1.373 --- ZendEngine2/zend.c:1.372 Tue Sep 19 20:44:37 2006 +++ ZendEngine2/zend.c Fri Sep 29 20:59:26 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.372 2006/09/19 20:44:37 andrei Exp $ */ +/* $Id: zend.c,v 1.373 2006/09/29 20:59:26 andrei Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -929,11 +929,26 @@ unicode_globals->to_error_mode = ZEND_CONV_ERROR_STOP; unicode_globals->conv_error_handler = NULL; + { + UErrorCode status = U_ZERO_ERROR; + + unicode_globals->root_collator = ucol_open("en_US", &status); + ucol_setStrength(unicode_globals->root_collator, UCOL_PRIMARY); + unicode_globals->root_search = usearch_openFromCollator(EMPTY_STR, 1, EMPTY_STR, 1, + unicode_globals->root_collator, NULL, &status); + } + zend_hash_init_ex(&unicode_globals->flex_compatible, 0, NULL, NULL, 1, 0); } static void unicode_globals_dtor(zend_unicode_globals *unicode_globals TSRMLS_DC) { + if (unicode_globals->root_collator) { + ucol_close(unicode_globals->root_collator); + } + if (unicode_globals->root_search) { + usearch_close(unicode_globals->root_search); + } if (unicode_globals->fallback_encoding_conv) { ucnv_close(unicode_globals->fallback_encoding_conv); } http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_globals.h?r1=1.163&r2=1.164&diff_format=u Index: ZendEngine2/zend_globals.h diff -u ZendEngine2/zend_globals.h:1.163 ZendEngine2/zend_globals.h:1.164 --- ZendEngine2/zend_globals.h:1.163 Tue Sep 19 20:36:48 2006 +++ ZendEngine2/zend_globals.h Fri Sep 29 20:59:26 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_globals.h,v 1.163 2006/09/19 20:36:48 pollita Exp $ */ +/* $Id: zend_globals.h,v 1.164 2006/09/29 20:59:26 andrei Exp $ */ #ifndef ZEND_GLOBALS_H #define ZEND_GLOBALS_H @@ -37,6 +37,7 @@ #include <unicode/ucnv.h> #include <unicode/ucol.h> +#include <unicode/usearch.h> /* Define ZTS if you want a thread-safe Zend */ /*#undef ZTS*/ @@ -286,6 +287,8 @@ char *default_locale; zend_collator *default_collator; + UCollator *root_collator; + UStringSearch *root_search; HashTable flex_compatible; /* table of flex-compatible encodings */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_unicode.c?r1=1.28&r2=1.29&diff_format=u Index: ZendEngine2/zend_unicode.c diff -u ZendEngine2/zend_unicode.c:1.28 ZendEngine2/zend_unicode.c:1.29 --- ZendEngine2/zend_unicode.c:1.28 Tue Aug 8 16:58:06 2006 +++ ZendEngine2/zend_unicode.c Fri Sep 29 20:59:26 2006 @@ -741,7 +741,7 @@ while (1) { *status = U_ZERO_ERROR; buffer = eurealloc(buffer, buffer_len+1); - buffer_len = u_strFoldCase(buffer, buffer_len+1, src, src_len, options, status); + buffer_len = u_strFoldCase(buffer, buffer_len, src, src_len, options, status); if (*status != U_BUFFER_OVERFLOW_ERROR) { break; }

« previous php.zend-engine.cvs (#5283) next »