summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-10-13 16:24:00 +0000
committerAndi Gutmans <andi@php.net>2000-10-13 16:24:00 +0000
commitbc37c9b1cd102a9f9c9661db9895d29c333b0ba2 (patch)
tree2cd1b23b3c4701be254f64a8f1c3e9543be45832 /Zend/zend_operators.c
parent545ae277bc213a849cc729c84f2881a19b2d2a07 (diff)
downloadphp-git-bc37c9b1cd102a9f9c9661db9895d29c333b0ba2.tar.gz
- Make increment of "" become "1"
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c7
1 files changed, 7 insertions, 0 deletions
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') {