summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-09-30 16:24:58 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-09-30 16:24:58 +0000
commit9b01d9b96ee0b2f53e5435498165098dab8792d9 (patch)
tree02c4453b486a5fb0b6dacd0192a6e21c711618b6 /regexec.c
parent757edf6f97fa376b72d1a074f68bfc7b1e9c441b (diff)
downloadperl-9b01d9b96ee0b2f53e5435498165098dab8792d9.tar.gz
Retract #4252, didn't help with the original problem.
p4raw-id: //depot/cfgperl@4262
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/regexec.c b/regexec.c
index 698142450e..a567353311 100644
--- a/regexec.c
+++ b/regexec.c
@@ -739,23 +739,19 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
/* If there is a "must appear" string, look for it. */
s = startpos;
- if (prog->reganch & ROPT_GPOS_SEEN) { /* Need to have PL_reg_ganch */
+ if (prog->reganch & ROPT_GPOS_SEEN) {
MAGIC *mg;
- if (flags & REXEC_IGNOREPOS)
+ 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;
- else if (sv && SvTYPE(sv) >= SVt_PVMG
- && SvMAGIC(sv)
- && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0) {
- PL_reg_ganch = strbeg + mg->mg_len; /* Defined pos() */
- if (prog->reganch & ROPT_ANCH_GPOS) {
- if (s > PL_reg_ganch)
- goto phooey;
- s = PL_reg_ganch;
- }
+ if (prog->reganch & ROPT_ANCH_GPOS) {
+ if (s > PL_reg_ganch)
+ goto phooey;
+ s = PL_reg_ganch;
}
- else
- PL_reg_ganch = strbeg;
}
if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) {