summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-06 03:22:46 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-06 03:22:46 +0000
commitf5f7a0b482a96221fe45c96ca998d928c8ea7eff (patch)
tree3b31f97fa52e2b424a5ad64b9c52a42de51854a5 /regexec.c
parentbf49b057b09bec860588a9b554c3a77683394722 (diff)
parent30382c73ff93b57b951492a5a0d1cba2de577e49 (diff)
downloadperl-f5f7a0b482a96221fe45c96ca998d928c8ea7eff.tar.gz
integrate cfgperl contents into mainline
p4raw-id: //depot/perl@4303
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/regexec.c b/regexec.c
index 0c4cc9546f..ed7436933b 100644
--- a/regexec.c
+++ b/regexec.c
@@ -739,19 +739,23 @@ 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) {
+ if (prog->reganch & ROPT_GPOS_SEEN) { /* Need to have PL_reg_ganch */
MAGIC *mg;
- 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
+ if (flags & REXEC_IGNOREPOS) /* Means: check only at start */
PL_reg_ganch = startpos;
- if (prog->reganch & ROPT_ANCH_GPOS) {
- if (s > PL_reg_ganch)
- goto phooey;
- s = PL_reg_ganch;
+ 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;
+ }
}
+ else /* pos() not defined */
+ PL_reg_ganch = strbeg;
}
if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) {