aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-19 10:37:38 +0000
committerRichard M. Stallman1994-11-19 10:37:38 +0000
commit5f5a1fec3cb6b6553c92ce3bf6577857b23436f1 (patch)
treea2340d6e398e8ad1493ef5527e4e20e9ad335087 /src
parentb819a39025f5224ec3b554776ec20fb1b50f3043 (diff)
downloademacs-5f5a1fec3cb6b6553c92ce3bf6577857b23436f1.tar.gz
emacs-5f5a1fec3cb6b6553c92ce3bf6577857b23436f1.zip
(re_compile_fastmap): Really treat `succeed' like end.
Diffstat (limited to 'src')
-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)
2782 bufp->fastmap_accurate = 1; /* It will be when we're done. */ 2782 bufp->fastmap_accurate = 1; /* It will be when we're done. */
2783 bufp->can_be_null = 0; 2783 bufp->can_be_null = 0;
2784 2784
2785 while (p != pend || !FAIL_STACK_EMPTY ()) 2785 while (1)
2786 { 2786 {
2787 if (p == pend || *p == succeed) 2787 if (p == pend || *p == succeed)
2788 { 2788 {
2789 bufp->can_be_null |= path_can_be_null; 2789 /* We have reached the (effective) end of pattern. */
2790 2790 if (!FAIL_STACK_EMPTY ())
2791 /* Reset for next path. */ 2791 {
2792 path_can_be_null = true; 2792 bufp->can_be_null |= path_can_be_null;
2793 2793
2794 p = fail_stack.stack[--fail_stack.avail]; 2794 /* Reset for next path. */
2795 path_can_be_null = true;
2796
2797 p = fail_stack.stack[--fail_stack.avail];
2798 }
2799 else
2800 break;
2795 } 2801 }
2796 2802
2797 /* We should never be about to go beyond the end of the pattern. */ 2803 /* We should never be about to go beyond the end of the pattern. */