diff --git a/src/regex-emacs.c b/src/regex-emacs.c index 338323cf79e..ae82dd63917 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -3086,8 +3086,10 @@ analyze_first (re_char *p, re_char *pend, char *fastmap, bool multibyte) /* We only care about one iteration of the loop, so we don't need to consider the case where this behaves like an on_failure_jump. */ - continue; - + /* FIXME: Sadly, the above is not true when the loop's body + can match the empty string :-( */ + /* continue; */ + return -1; case set_number_at: p += 4; diff --git a/test/src/regex-resources/PTESTS b/test/src/regex-resources/PTESTS index 68acc314d37..59dd4b3bc21 100644 --- a/test/src/regex-resources/PTESTS +++ b/test/src/regex-resources/PTESTS @@ -269,6 +269,7 @@ #W the expected result for \([a-c]*\)\{2,\} is failure which isn't correct 1¦3¦\([a-c]*\)\{2,\}¦abcdefg¦ 1¦3¦\([a-c]*\)\{1,\}¦abcdefg¦ +0¦0¦\([a-c]*\)\{2,\}¦gabcdefg¦ -1¦-1¦a\{64,\}¦aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa¦ # GA142 1¦3¦a\{2,3\}¦aaaa¦