diff options
author | Andrei Zmievski <andrei@php.net> | 2000-08-24 13:23:13 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2000-08-24 13:23:13 +0000 |
commit | d7c43de3cee9918ce1ffbdde178bab409dac5128 (patch) | |
tree | c9b39a2c4fe15d2ab390bb152678489c3e6c484c /ext/pcre/php_pcre.c | |
parent | 876bac4823f961404a2c3150fc40584ec5bdae68 (diff) | |
download | php-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.c | 7 |
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 |