summaryrefslogtreecommitdiff
path: root/src/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regex.c b/src/regex.c
index a53eac29216..130765134f5 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2558,8 +2558,8 @@ regex_compile (pattern, size, syntax, bufp)
}
/* If the spaces are followed by a repetition op,
treat them normally. */
- if (p1 == pend
- || (*p1 == '*' || *p1 == '+' || *p1 == '?'
+ if (p1 != pend
+ && (*p1 == '*' || *p1 == '+' || *p1 == '?'
|| (*p1 == '\\' && p1 + 1 != pend && p1[1] == '{')))
goto normal_char;