summaryrefslogtreecommitdiff
path: root/src/regex.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-11-19 10:37:38 +0000
committerRichard M. Stallman <rms@gnu.org>1994-11-19 10:37:38 +0000
commita6e426902e9fdb96282136f30e451f5073417773 (patch)
tree90f39e44ef312a97e70320e187063163a1c62878 /src/regex.c
parent35cf5d60339a3128b04f8410b8ba2820676c06a7 (diff)
downloademacs-a6e426902e9fdb96282136f30e451f5073417773.tar.gz
(re_compile_fastmap): Really treat `succeed' like end.
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/regex.c b/src/regex.c
index 0adb68c7c9f..4a590509be7 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2782,16 +2782,22 @@ re_compile_fastmap (bufp)
bufp->fastmap_accurate = 1; /* It will be when we're done. */
bufp->can_be_null = 0;
- while (p != pend || !FAIL_STACK_EMPTY ())
+ while (1)
{
if (p == pend || *p == succeed)
- {
- bufp->can_be_null |= path_can_be_null;
-
- /* Reset for next path. */
- path_can_be_null = true;
-
- p = fail_stack.stack[--fail_stack.avail];
+ {
+ /* We have reached the (effective) end of pattern. */
+ if (!FAIL_STACK_EMPTY ())
+ {
+ bufp->can_be_null |= path_can_be_null;
+
+ /* Reset for next path. */
+ path_can_be_null = true;
+
+ p = fail_stack.stack[--fail_stack.avail];
+ }
+ else
+ break;
}
/* We should never be about to go beyond the end of the pattern. */