felipe                                   Sat, 13 Nov 2010 19:50:55 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=305328

Log:
- Fix the constant detection

Changed paths:
    U   php/php-src/branches/PHP_5_3/Zend/zend_constants.c
    U   php/php-src/trunk/Zend/zend_constants.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_constants.c
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_constants.c  2010-11-13 18:46:11 UTC 
(rev 305327)
+++ php/php-src/branches/PHP_5_3/Zend/zend_constants.c  2010-11-13 19:50:55 UTC 
(rev 305328)
@@ -440,7 +440,7 @@
                || zend_hash_add(EG(zend_constants), name, c->name_len, (void 
*) c, sizeof(zend_constant), NULL)==FAILURE) {

                /* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL 
byte */
-               if (strncmp(name+1, "__COMPILER_HALT_OFFSET__", 
sizeof("__COMPILER_HALT_OFFSET__")) == 0) {
+               if (memcmp(name, "\0__COMPILER_HALT_OFFSET__", 
sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
                        name++;
                }
                zend_error(E_NOTICE,"Constant %s already defined", name);

Modified: php/php-src/trunk/Zend/zend_constants.c
===================================================================
--- php/php-src/trunk/Zend/zend_constants.c     2010-11-13 18:46:11 UTC (rev 
305327)
+++ php/php-src/trunk/Zend/zend_constants.c     2010-11-13 19:50:55 UTC (rev 
305328)
@@ -479,7 +479,7 @@
                || zend_hash_add(EG(zend_constants), name, c->name_len, (void 
*) c, sizeof(zend_constant), NULL)==FAILURE) {

                /* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL 
byte */
-               if (strncmp(name+1, "__COMPILER_HALT_OFFSET__", 
sizeof("__COMPILER_HALT_OFFSET__")) == 0) {
+               if (memcmp(name, "\0__COMPILER_HALT_OFFSET__", 
sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
                        name++;
                }
                zend_error(E_NOTICE,"Constant %s already defined", name);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to