summaryrefslogtreecommitdiff
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
parent757edf6f97fa376b72d1a074f68bfc7b1e9c441b (diff)
downloadperl-9b01d9b96ee0b2f53e5435498165098dab8792d9.tar.gz
Retract #4252, didn't help with the original problem.
p4raw-id: //depot/cfgperl@4262
-rw-r--r--regexec.c22
-rw-r--r--t/op/re_tests1
2 files changed, 9 insertions, 14 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) {
diff --git a/t/op/re_tests b/t/op/re_tests
index e89945401f..b35e964dc1 100644
--- a/t/op/re_tests
+++ b/t/op/re_tests
@@ -739,4 +739,3 @@ tt+$ xxxtt y - -
[\w-z] - c - /[\w-z]/: invalid [] range in regexp
[0-[:digit:]] - c - /[0-[:digit:]]/: invalid [] range in regexp
[[:digit:]-9] - c - /[[:digit:]-9]/: invalid [] range in regexp
-\GX.X aaaXbX n - -