summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2000-08-24 13:23:13 +0000
committerAndrei Zmievski <andrei@php.net>2000-08-24 13:23:13 +0000
commitd7c43de3cee9918ce1ffbdde178bab409dac5128 (patch)
treec9b39a2c4fe15d2ab390bb152678489c3e6c484c /ext/pcre/php_pcre.c
parent876bac4823f961404a2c3150fc40584ec5bdae68 (diff)
downloadphp-git-d7c43de3cee9918ce1ffbdde178bab409dac5128.tar.gz
@- Fixed a bug that did not respect limit parameter in preg_replace() when
@ using /e modifier. (Andrei)
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 4641067904..7c6f75b477 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -720,10 +720,11 @@ char *php_pcre_replace(char *regex, int regex_len,
*walkbuf = '\0';
/* increment the result length by how much we've added to the string */
*result_len += walkbuf - (result + *result_len);
-
- if (limit != -1)
- limit--;
}
+
+ if (limit != -1)
+ limit--;
+
} else { /* Failed to match */
/* If we previously set PCRE_NOTEMPTY after a null match,
this is not necessarily the end. We need to advance