summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2012-01-29 00:06:23 +0100
committerYves Orton <demerphq@gmail.com>2012-01-29 00:06:23 +0100
commit21eede782bed11b0263f9bff02b9ca7b7dfcd6eb (patch)
tree2435203d2ccb8e1f5b405748e03d915241548b4a /regexec.c
parent745b54e4438760197284db88e618b43be29d74ab (diff)
downloadperl-21eede782bed11b0263f9bff02b9ca7b7dfcd6eb.tar.gz
Fix bug #109206: ANCH_MBOL with while /.*/g
We had a fencepost error when ANCH_MBOL was enabled that meant we did not "see" matches at the end of string. This fixes the problem and adds tests.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 6bd8b20b60..b84dcbd8b7 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2245,8 +2245,8 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, register char *stre
/*XXX: The s-- is almost definitely wrong here under unicode - demeprhq*/
s--;
}
- /* We can use a more efficient search as newlines are the same in unicode as they are in latin */
- while (s < end) {
+ /* We can use a more efficient search as newlines are the same in unicode as they are in latin */
+ while (s <= end) { /* note it could be possible to match at the end of the string */
if (*s++ == '\n') { /* don't need PL_utf8skip here */
if (regtry(&reginfo, &s))
goto got_it;