diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-17 17:45:58 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-17 17:45:58 +0000 |
commit | 60e71179391c62fd08759b910342438d90159dc2 (patch) | |
tree | 4663b1dd2e7608f3c046f29ec7777ba4b4adfd09 | |
parent | f9d788ebc632d47c20d6ded8983f6695a28922b9 (diff) | |
download | perl-60e71179391c62fd08759b910342438d90159dc2.tar.gz |
fix for C<"\nx\taa\n" =~ /^\S\s+aa$/m> (from Ilya Zakharevich)
p4raw-id: //depot/perl@4693
-rw-r--r-- | regexec.c | 16 | ||||
-rw-r--r-- | t/op/re_tests | 1 |
2 files changed, 11 insertions, 6 deletions
@@ -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 357b705158..e957609071 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 - - |