summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-12-08 11:02:04 +0200
committerJarkko Hietaniemi <jhi@iki.fi>1998-12-29 11:27:11 +0000
commitad94a51148da69b36625e16c155cd6147ed14f1a (patch)
tree81185c6bda2609aafa161d1fb093e26315fe3d4b /regexec.c
parent54b6e2faa887aa86b7b0c280adebcdc0f0804c55 (diff)
downloadperl-ad94a51148da69b36625e16c155cd6147ed14f1a.tar.gz
Bugs in hairy interactions of feature in REx
To: perl5-porters@perl.org (Mailing list Perl5) Message-ID: <MLIST_199812080637.BAA16025@monk.mps.ohio-state.edu> \G fixes (wasn't working right with //g, s///, and $_ in (?{})). p4raw-id: //depot/cfgperl@2515
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/regexec.c b/regexec.c
index 53b1664ef4..c4106270a1 100644
--- a/regexec.c
+++ b/regexec.c
@@ -418,12 +418,12 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend,
if (prog->reganch & ROPT_GPOS_SEEN) {
MAGIC *mg;
- int pos = 0;
- if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)
- && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0)
- pos = mg->mg_len;
- PL_reg_ganch = startpos + pos;
+ if (!(flags & REXEC_IGNOREPOS) && sv && SvTYPE(sv) >= SVt_PVMG
+ && SvMAGIC(sv) && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0)
+ PL_reg_ganch = strbeg + mg->mg_len;
+ else
+ PL_reg_ganch = startpos;
}
/* Simplest case: anchored match need be tried only once. */