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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index d17b493d36..ee8b6218fe 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -199,7 +199,8 @@ static pcre* _pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_
found, display a warning. */
pp = p;
while (*pp != 0) {
- if (*pp == delimiter && pp[-1] != '\\')
+ if (*pp == '\\' && pp[1] != 0) pp++;
+ else if (*pp == delimiter)
break;
pp++;
}