For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > September 2006 > cvs: ZendEngine2 / zend.c zend_globals.h zend_unicode.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend.c zend_globals.h zend_unicode.c
Andrei Zmievski

2006-09-29, 6:56 pm

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/ZendE...3&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_global
s *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/ZendE...4&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/ZendE...9&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;
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com