From: Jarkko Hietaniemi Date: Thu, 30 Sep 1999 16:24:58 +0000 (+0000) Subject: Retract #4252, didn't help with the original problem. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b01d9b96ee0b2f53e5435498165098dab8792d9;p=p5sagit%2Fp5-mst-13.2.git Retract #4252, didn't help with the original problem. p4raw-id: //depot/cfgperl@4262 --- diff --git a/regexec.c b/regexec.c index 6981424..a567353 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 e899454..b35e964 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 - -