summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorAndreas König <a.koenig@mind.de>2005-11-04 09:17:25 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-11-04 16:26:08 +0000
commite0efdaf8e9240c19cd4636de8080d872bb373f7f (patch)
tree9d0d3182ccbc40d0448a2096b2706d5b1111ddb5 /regexec.c
parentd7507f7459e6b42ee8cfc80abf2510fc2ff6a5c0 (diff)
downloadperl-e0efdaf8e9240c19cd4636de8080d872bb373f7f.tar.gz
[perl #19049] Incorrect $` after replacement
Message-ID: <87fyqc51bu.fsf@k75.linux.bogus> p4raw-id: //depot/perl@25993
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index e058216ce6..d4ec7c2635 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2177,7 +2177,7 @@ S_regtry(pTHX_ regexp *prog, char *startpos)
prog->subbeg = PL_bostr;
prog->sublen = PL_regeol - PL_bostr; /* strend may have been modified */
}
- prog->startp[0] = startpos - PL_bostr;
+ /* prog->startp[0] = startpos - PL_bostr; */
PL_reginput = startpos;
PL_regstartp = prog->startp;
PL_regendp = prog->endp;
@@ -2221,6 +2221,7 @@ S_regtry(pTHX_ regexp *prog, char *startpos)
#endif
REGCP_SET(lastcp);
if (regmatch(prog->program + 1)) {
+ prog->startp[0] = startpos - PL_bostr;
prog->endp[0] = PL_reginput - PL_bostr;
return 1;
}