summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
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