cvs: ZendEngine2 / zend_API.c

From: Date: Fri, 04 Aug 2006 17:02:17 +0000
Subject: cvs: ZendEngine2 / zend_API.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5157@lists.php.net to get a copy of this message
andrei Fri Aug 4 17:02:17 2006 UTC Modified files: /ZendEngine2 zend_API.c Log: Scan through all the modifiers at once, setting flags. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.391&r2=1.392&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.391 ZendEngine2/zend_API.c:1.392 --- ZendEngine2/zend_API.c:1.391 Fri Aug 4 16:58:29 2006 +++ ZendEngine2/zend_API.c Fri Aug 4 17:02:17 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.391 2006/08/04 16:58:29 andrei Exp $ */ +/* $Id: zend_API.c,v 1.392 2006/08/04 17:02:17 andrei Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -315,12 +315,20 @@ char *spec_walk = *spec; char c = *spec_walk++; int return_null = 0; + int alternate_form = 0; - while (*spec_walk == '/' || *spec_walk == '!') { + /* scan through modifiers */ + while (1) { if (*spec_walk == '/') { SEPARATE_ZVAL_IF_NOT_REF(arg); - } else if (*spec_walk == '!' && Z_TYPE_PP(arg) == IS_NULL) { - return_null = 1; + } else if (*spec_walk == '&') { + alternate_form = 1; + } else if (*spec_walk == '!') { + if (Z_TYPE_PP(arg) == IS_NULL) { + return_null = 1; + } + } else { + break; } spec_walk++; } @@ -427,7 +435,7 @@ int *pl = va_arg(*va, int *); UConverter *conv = NULL; - if (c == 's' && *spec_walk == '&') { + if (c == 's' && alternate_form) { conv = va_arg(*va, UConverter *); spec_walk++; }

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