regcomp.c: Skip calculating a pass2 value in pass1
authorKarl Williamson <public@khwilliamson.com>
Sun, 11 Aug 2013 01:02:49 +0000 (19:02 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 15 Aug 2013 04:07:46 +0000 (22:07 -0600)
The result of this value at the end of the loop is discarded in pass1 of
the regex compilation, so don't bother to calculate it.

regcomp.c

index 91765f0..4995353 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10773,8 +10773,8 @@ tryagain:
 
             /* We do the EXACTFish to EXACT node only if folding, and not if in
              * locale, as whether a character folds or not isn't known until
-             * runtime */
-            maybe_exact = FOLD && ! LOC;
+             * runtime.  (And we don't need to figure this out until pass 2) */
+            maybe_exact = FOLD && ! LOC && PASS2;
 
            /* XXX The node can hold up to 255 bytes, yet this only goes to
              * 127.  I (khw) do not know why.  Keeping it somewhat less than