re_intuit_start(): add comments to a block of code
authorDavid Mitchell <davem@iabyn.com>
Fri, 27 Dec 2013 22:12:31 +0000 (22:12 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 7 Feb 2014 22:39:36 +0000 (22:39 +0000)
explain what it does!

regexec.c

index 9f0e2c6..36b4bed 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -699,6 +699,10 @@ Perl_re_intuit_start(pTHX_
                goto fail;
            }
 
+            /* in the presence of an anchor, the anchored (relative to the
+             * start of the regex) substr must also be anchored relative
+             * to strpos. So quickly reject if substr isn't found there */
+
            if (prog->check_offset_min == prog->check_offset_max
                 && !(prog->intflags & PREGf_CANY_SEEN)
                 && ! multiline)   /* /m can cause \n's to match that aren't