From: Andi Gutmans Date: Fri, 13 Oct 2000 16:24:00 +0000 (+0000) Subject: - Make increment of "" become "1" X-Git-Tag: php-4.0.4RC3~691 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc37c9b1cd102a9f9c9661db9895d29c333b0ba2;p=php - Make increment of "" become "1" --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index b112a50257..6a4402a935 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1339,6 +1339,13 @@ static void increment_string(zval *str) int last=0; /* Shut up the compiler warning */ int ch; + if (str->value.str.len == 0) { + STR_FREE(str->value.str.val); + str->value.str.val = estrndup("1", sizeof("1")-1); + str->value.str.len = 1; + return; + } + while(pos >= 0) { ch = s[pos]; if (ch >= 'a' && ch <= 'z') {