summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-10-16 11:40:13 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-17 17:04:28 -0600
commit8a90a8fee1032a1bdee2a164f8265ff160fe22f0 (patch)
treec4295245e6fd8e94c60228db774b2cbfb44d51ca /regexec.c
parentc3fd22462ebb1d1818df45e5f68bf60ca84c813c (diff)
downloadperl-8a90a8fee1032a1bdee2a164f8265ff160fe22f0.tar.gz
regexec.c: Add comment
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 1e4bd629c5..4abb71234c 100644
--- 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) {