summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorJeff Pinyan <japhy@pobox.com>2001-11-14 11:35:29 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-16 14:46:17 +0000
commita759488c42337f2d751890dc78d770629879b394 (patch)
tree8342df461ed96deaf63f5d83ed0a052f06c4b411 /pp_hot.c
parent07fcf8ff4a18d7bde9f6b306fe8bbb50d0153ff4 (diff)
downloadperl-a759488c42337f2d751890dc78d770629879b394.tar.gz
Re: [PATCH regcomp.[ch], regexp.h, pp_hot.c, t/op/re_tests] lazy $& and \Z fix
Message-ID: <Pine.GSO.4.21.0111141634020.16649-100000@crusoe.crusoe.net> p4raw-id: //depot/perl@13048
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/pp_hot.c b/pp_hot.c
index f1274a63e4..77e070fbb7 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1264,9 +1264,7 @@ PP(pp_match)
}
}
}
- if ((!global && rx->nparens)
- || SvTEMP(TARG) || PL_sawampersand)
- r_flags |= REXEC_COPY_STR;
+ r_flags |= REXEC_COPY_STR;
if (SvSCREAM(TARG))
r_flags |= REXEC_SCREAM;
@@ -1291,7 +1289,7 @@ play_it_again:
if (!s)
goto nope;
if ( (rx->reganch & ROPT_CHECK_ALL)
- && !PL_sawampersand
+ && !((rx->reganch & ROPT_SEOL_SEEN) && PL_multiline)
&& ((rx->reganch & ROPT_NOSCAN)
|| !((rx->reganch & RE_INTUIT_TAIL)
&& (r_flags & REXEC_SCREAM)))
@@ -1408,19 +1406,12 @@ yup: /* Confirmed by INTUIT */
rx->sublen = strend - truebase;
goto gotcha;
}
- if (PL_sawampersand) {
- I32 off;
- rx->subbeg = savepvn(t, strend - t);
- rx->sublen = strend - t;
- RX_MATCH_COPIED_on(rx);
- off = rx->startp[0] = s - t;
- rx->endp[0] = off + rx->minlen;
- }
- else { /* startp/endp are used by @- @+. */
- rx->startp[0] = s - truebase;
- rx->endp[0] = s - truebase + rx->minlen;
- }
+ rx->sublen = strend - t;
+ rx->subbeg = savepvn(t, rx->sublen);
+ RX_MATCH_COPIED_on(rx);
+ rx->startp[0] = s - truebase;
+ rx->endp[0] = s - truebase + rx->minlen;
rx->nparens = rx->lastparen = 0; /* used by @- and @+ */
LEAVE_SCOPE(oldsave);
RETPUSHYES;