fix for C<"\nx\taa\n" =~ /^\S\s+aa$/m> (from Ilya Zakharevich)
Gurusamy Sarathy [Fri, 17 Dec 1999 17:45:58 +0000 (17:45 +0000)]
p4raw-id: //depot/perl@4693

regexec.c
t/op/re_tests

index adde1dd..4a674a8 100644 (file)
--- 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;
index 357b705..e957609 100644 (file)
@@ -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       -       -