From: Andrei Zmievski Date: Thu, 24 Aug 2000 13:23:13 +0000 (+0000) Subject: @- Fixed a bug that did not respect limit parameter in preg_replace() when X-Git-Tag: php-4.0.2~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7c43de3cee9918ce1ffbdde178bab409dac5128;p=php @- Fixed a bug that did not respect limit parameter in preg_replace() when @ using /e modifier. (Andrei) --- 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