From: Gurusamy Sarathy Date: Fri, 17 Dec 1999 17:45:58 +0000 (+0000) Subject: fix for C<"\nx\taa\n" =~ /^\S\s+aa$/m> (from Ilya Zakharevich) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=60e71179391c62fd08759b910342438d90159dc2;p=p5sagit%2Fp5-mst-13.2.git fix for C<"\nx\taa\n" =~ /^\S\s+aa$/m> (from Ilya Zakharevich) p4raw-id: //depot/perl@4693 --- diff --git a/regexec.c b/regexec.c index adde1dd..4a674a8 100644 --- a/regexec.c +++ b/regexec.c @@ -730,13 +730,17 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, (long)(other_last - i_strpos)) ); goto do_other_anchored; } - if (!prog->float_substr) { /* Could have been deleted */ - if (ml_anch) { - s = t = t + 1; - goto try_at_offset; - } - goto fail; + /* Another way we could have checked stclass at the + current position only: */ + if (ml_anch) { + s = t = t + 1; + DEBUG_r( PerlIO_printf(Perl_debug_log, + "Trying /^/m starting at offset %ld...\n", + (long)(t - i_strpos)) ); + goto try_at_offset; } + if (!prog->float_substr) /* Could have been deleted */ + goto fail; /* Check is floating subtring. */ retry_floating_check: t = check_at - start_shift; diff --git a/t/op/re_tests b/t/op/re_tests index 357b705..e957609 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -748,3 +748,4 @@ tt+$ xxxtt y - - '\.c(pp|xx|c)?$'i IO.c y - - '(\.c(pp|xx|c)?$)'i IO.c y $1 .c ^([a-z]:) C:/ n - - +'^\S\s+aa$'m \nx aa y - -