cvs: ZendEngine2 / zend_constants.c

From: Date: Tue, 20 May 2008 15:29:01 +0000
Subject: cvs: ZendEngine2 / zend_constants.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6742@lists.php.net to get a copy of this message
tony2001 Tue May 20 15:29:01 2008 UTC Modified files: /ZendEngine2 zend_constants.c Log: use correct check for unicode strings may be still strings, even in Unicode mode http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_constants.c?r1=1.109&r2=1.110&diff_format=u Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.109 ZendEngine2/zend_constants.c:1.110 --- ZendEngine2/zend_constants.c:1.109 Sat Feb 23 17:03:51 2008 +++ ZendEngine2/zend_constants.c Tue May 20 15:29:01 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_constants.c,v 1.109 2008/02/23 17:03:51 helly Exp $ */ +/* $Id: zend_constants.c,v 1.110 2008/05/20 15:29:01 tony2001 Exp $ */ #include "zend.h" #include "zend_constants.h" @@ -337,18 +337,18 @@ flags &= ZEND_FETCH_CLASS_SILENT; } - if ((UG(unicode) && (colon.u = u_memrchr(name.u, ':', name_len)) && colon.u > name.u && *(colon.u-1) == ':') || - (!UG(unicode) && (colon.s = zend_memrchr(name.s, ':', name_len))&& colon.s > name.s && *(colon.s-1) == ':')) { + if ((type == IS_UNICODE && (colon.u = u_memrchr(name.u, ':', name_len)) && colon.u > name.u && *(colon.u-1) == ':') || + (!type == IS_STRING && (colon.s = zend_memrchr(name.s, ':', name_len))&& colon.s > name.s && *(colon.s-1) == ':')) { /* compound constant name */ zend_class_entry *ce = NULL; - int class_name_len = UG(unicode)?colon.u-name.u-1:colon.s-name.s-1; + int class_name_len = (type == IS_UNICODE) ? colon.u-name.u-1 : colon.s-name.s-1; int const_name_len = name_len - class_name_len - 2; zstr constant_name, class_name; zval **ret_constant; zstr lcname; unsigned int lcname_len; - if (UG(unicode)) { + if (type == IS_UNICODE) { constant_name.u = colon.u + 1; } else { constant_name.s = colon.s + 1; @@ -362,7 +362,7 @@ } } - if (UG(unicode)) { + if (type == IS_UNICODE) { class_name.u = eustrndup(name.u, class_name_len); } else { class_name.s = estrndup(name.s, class_name_len); @@ -403,7 +403,7 @@ unsigned int nsname_len; /* Concatenate lowercase namespace name and constant name */ - if (UG(unicode)) { + if (type == IS_UNICODE) { lcname.u = erealloc(lcname.u, UBYTES(lcname_len + 2 + const_name_len + 1)); lcname.u[lcname_len] = ':'; lcname.u[lcname_len+1] = ':'; @@ -420,7 +420,7 @@ nsname_len = lcname_len; if (flags & ZEND_FETCH_CLASS_RT_NS_NAME) { /* Remove namespace name */ - if (UG(unicode)) { + if (type == IS_UNICODE) { nsname.u = u_memchr(nsname.u, ':', nsname_len) + 2; nsname_len -= (nsname.u - lcname.u); } else {

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