From a71a26b9d7ab2e06dbec23ea8c1c1fa2d20af3f2 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Tue, 4 Feb 2014 21:01:58 +0000 Subject: [PATCH] re_intuit_start(): simplify the /^.../m condition The commit-but-last merged two conditions into a single messy one; now simplify it. Note that in the case of /.*.../, which sets MBOL and IMPLICIT, we should never arrive with strpos != rx_origin, since the .* forces the origin as far back as it will go. --- regexec.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/regexec.c b/regexec.c index 24a6826..670ff0b 100644 --- a/regexec.c +++ b/regexec.c @@ -1089,11 +1089,9 @@ Perl_re_intuit_start(pTHX_ /* handle the extra constraint of /^/m */ - if ( ((rx_origin != strpos) && (ml_anch && rx_origin[-1] != '\n')) - || ((rx_origin == strpos) && - (ml_anch && (strpos != strbeg) && strpos[-1] != '\n' - /* May be due to an implicit anchor of m{.*foo} */ - && !(prog->intflags & PREGf_IMPLICIT)))) + if (ml_anch && rx_origin != strbeg && rx_origin[-1] != '\n' + /* May be due to an implicit anchor of m{.*foo} */ + && !(prog->intflags & PREGf_IMPLICIT)) { char *t; -- 2.7.4