Change 14157 by jhi@alpha on 2002/01/09 19:59:28
Subject: Re: [ID 20020109.002] /(?m:...\s*$)/ is not backtracking properly
From: Hugo van der Sanden <[EMAIL PROTECTED]>
Date: Wed, 09 Jan 2002 20:16:54 +0000
Message-Id: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/regexec.c#248 edit
Differences ...
==== //depot/perl/regexec.c#248 (text) ====
Index: perl/regexec.c
--- perl/regexec.c.~1~ Wed Jan 9 13:15:05 2002
+++ perl/regexec.c Wed Jan 9 13:15:05 2002
@@ -3586,7 +3586,9 @@
n = regrepeat(scan, n);
locinput = PL_reginput;
if (ln < n && PL_regkind[(U8)OP(next)] == EOL &&
- ((!PL_multiline && OP(next) != MEOL) || OP(next) == SEOL ||
OP(next) == EOS)) {
+ ((!PL_multiline && OP(next) != MEOL) ||
+ OP(next) == SEOL || OP(next) == EOS))
+ {
ln = n; /* why back off? */
/* ...because $ and \Z can match before *and* after
newline at the end. Consider "\n\n" =~ /\n+\Z\n/.
End of Patch.