summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/regex.c b/regex.c
index 40b22bc3a8..9d0dc9f4bd 100644
--- a/regex.c
+++ b/regex.c
@@ -2718,8 +2718,9 @@ re_search(bufp, string, size, startpos, range, regs)
if (range > 0) {
if (startpos > 0)
return -1;
- else
- return re_match(bufp, string, size, 0, regs);
+ else if (re_match(bufp, string, size, 0, regs) >= 0)
+ return 0;
+ return -1;
}
break;