summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-04-11 12:12:26 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-11 12:12:26 +0000
commit7e25d62cf96003a62100db76571e9180a337a185 (patch)
tree084ac478217a5d906b44eb2b782fbd6fb96e1dfc /regexec.c
parentbac331f5e518ae718fb4a25b9e4efbb108b55169 (diff)
downloadperl-7e25d62cf96003a62100db76571e9180a337a185.tar.gz
A more minimal fix for 20010410.006 from Hugo.
p4raw-id: //depot/perl@9682
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/regexec.c b/regexec.c
index 481ac58fb8..e358d63d5f 100644
--- a/regexec.c
+++ b/regexec.c
@@ -391,18 +391,20 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
|| ( (prog->reganch & ROPT_ANCH_BOL)
&& !PL_multiline ) ); /* Check after \n? */
- if ((prog->check_offset_min == prog->check_offset_max) && !ml_anch) {
+ if (!ml_anch) {
+ if ( !(prog->reganch & (ROPT_ANCH_GPOS /* Checked by the caller */
+ | ROPT_IMPLICIT)) /* not a real BOL */
+ /* SvCUR is not set on references: SvRV and SvPVX overlap */
+ && sv && !SvROK(sv)
+ && (strpos != strbeg)) {
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "Not at start...\n"));
+ goto fail;
+ }
+ if (prog->check_offset_min == prog->check_offset_max &&
+ !(prog->reganch & ROPT_SANY_SEEN)) {
/* Substring at constant offset from beg-of-str... */
I32 slen;
- if ( !(prog->reganch & ROPT_ANCH_GPOS) /* Checked by the caller */
- /* SvCUR is not set on references: SvRV and SvPVX overlap */
- && sv && !SvROK(sv)
- && (strpos != strbeg)) {
- DEBUG_r(PerlIO_printf(Perl_debug_log, "Not at start...\n"));
- goto fail;
- }
- PL_regeol = strend; /* Used in HOP() */
s = HOP3c(strpos, prog->check_offset_min, strend);
if (SvTAIL(check)) {
slen = SvCUR(check); /* >= 1 */
@@ -427,6 +429,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
&& memNE(SvPVX(check), s, slen)))
goto report_neq;
goto success_at_start;
+ }
}
/* Match is anchored, but substr is not anchored wrt beg-of-str. */
s = strpos;