This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Add comment
authorKarl Williamson <public@khwilliamson.com>
Sun, 16 Oct 2011 17:40:13 +0000 (11:40 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 17 Oct 2011 23:04:28 +0000 (17:04 -0600)
regexec.c

index 1e4bd62..4abb712 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1506,6 +1506,11 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
            pat_string = STRING(c);
            ln  = STR_LEN(c);   /* length to match in octets/bytes */
 
+           /* We know that we have to match at least 'ln' bytes (which is the
+            * same as characters, since not utf8).  If we have to match 3
+            * characters, and there are only 2 availabe, we know without
+            * trying that it will fail; so don't start a match past the
+            * required minimum number from the far end */
            e = HOP3c(strend, -((I32)ln), s);
 
            if (!reginfo && e < s) {