changeset 10021:9203331b118a

(re_compile_fastmap): Really treat `succeed' like end.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Nov 1994 10:37:38 +0000
parents c41ce96785a8
children 30e0dc7c07cd
files src/regex.c
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/regex.c	Sat Nov 19 10:00:14 1994 +0000
+++ b/src/regex.c	Sat Nov 19 10:37:38 1994 +0000
@@ -2782,16 +2782,22 @@
   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.  */