- Make unicode handling portable (noted by andrei)
authorMarcus Boerger <helly@php.net>
Fri, 3 Mar 2006 23:20:29 +0000 (23:20 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 3 Mar 2006 23:20:29 +0000 (23:20 +0000)
# Actually we should provide much more such unicode strings that we often
# use like 'parent', 'self' and so on.

Zend/zend_API.c
Zend/zend_execute.h
Zend/zend_execute_API.c

index dc906762958b8aa6b213043102f00ae513e4fdd3..4916f3d47c0c1869b09cf55ff254ab642be0901e 100644 (file)
@@ -2524,7 +2524,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze
        *fptr_ptr = NULL;
 
        if (Z_TYPE_P(callable) == IS_UNICODE) {
-               if ((colon.u = u_strstr(Z_USTRVAL_P(callable), (UChar*)":\0:\0\0")) != NULL) {
+               if ((colon.u = u_strstr(Z_USTRVAL_P(callable), u_doublecolon)) != NULL) {
                        mlen = u_strlen(colon.u+2);
                        clen = Z_USTRLEN_P(callable) - mlen - 2;
                        mname.u = colon.u + 2;
index e1c309ed9f86aaf6988a177a1f4e48ffc188410b..804fc0e8b4f2aba253f4494574c41f60976b3595 100644 (file)
@@ -46,6 +46,11 @@ typedef union _temp_variable {
 
 
 BEGIN_EXTERN_C()
+ZEND_API extern UChar u_main[sizeof("main")];
+ZEND_API extern UChar u_return[sizeof("return ")];
+ZEND_API extern UChar u_semicolon[sizeof(" ;")];
+ZEND_API extern UChar u_doublecolon[sizeof(" ;")];
+
 ZEND_API extern void (*zend_execute)(zend_op_array *op_array TSRMLS_DC);
 ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);
 
index f3eaabfa8be7c818a9e3ff65a4afdd78621e6986..efedd49e35eb735c515288e9465424f1e2b169ba 100644 (file)
@@ -51,14 +51,16 @@ static DWORD timeout_thread_id;
 static int timeout_thread_initialized=0;
 #endif
 
-static UChar u_main[sizeof("main")];
-static UChar u_return[sizeof("return ")];
-static UChar u_semicolon[sizeof(" ;")];
+UChar u_main[sizeof("main")];
+UChar u_return[sizeof("return ")];
+UChar u_semicolon[sizeof(" ;")];
+UChar u_doublecolon[sizeof(" ;")];
 
 void init_unicode_strings() {
        u_charsToUChars("main", u_main, sizeof("main"));
        u_charsToUChars("return ", u_return, sizeof("return "));
        u_charsToUChars(" ;", u_semicolon, sizeof(" ;"));
+       u_charsToUChars("::", u_doublecolon, sizeof("::"));
 }
 
 #if ZEND_DEBUG