summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index a2d6993..684c5c8 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2765,7 +2765,7 @@ slow_search(OnigEncoding enc, UChar* target, UChar* target_end,
if (*s == *target) {
p = s + 1;
t = target + 1;
- if (memcmp(t, p, target_end - t) == 0)
+ if (target_end == t || memcmp(t, p, target_end - t) == 0)
return s;
}
s += n;
@@ -2776,7 +2776,7 @@ slow_search(OnigEncoding enc, UChar* target, UChar* target_end,
if (*s == *target) {
p = s + 1;
t = target + 1;
- if (memcmp(t, p, target_end - t) == 0)
+ if (target_end == t || memcmp(t, p, target_end - t) == 0)
return s;
}
s += enclen(enc, s, end);