From: Hugo van der Sanden Date: Wed, 9 Jan 2002 20:16:54 +0000 (+0000) Subject: Re: [ID 20020109.002] /(?m:...\s*$)/ is not backtracking properly X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15272685321a1d817e718f8bbfc43bbedd9f4460;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20020109.002] /(?m:...\s*$)/ is not backtracking properly Message-Id: <200201092016.g09KGsi30119@crypt.compulink.co.uk> p4raw-id: //depot/perl@14157 --- diff --git a/regexec.c b/regexec.c index 1bc9983..bdd7c0d 100644 --- a/regexec.c +++ b/regexec.c @@ -3586,7 +3586,9 @@ S_regmatch(pTHX_ regnode *prog) 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/.