re_intuit_start(): change definition of ml_anch
authorDavid Mitchell <davem@iabyn.com>
Wed, 19 Mar 2014 16:44:25 +0000 (16:44 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 19 Mar 2014 18:25:55 +0000 (18:25 +0000)
commit7d2d37f505b570402d76d76649cc2464812a5881
treea4ebf621efff2526b888d0edd9322ee3c8a05a3e
parent343c8a296e416def92250d436a4ed6ffb932445f
re_intuit_start(): change definition of ml_anch

The ml_anch variable is supposed to indicate that a multi-line match is
possible, i.e. that the regex is anchored to a \n.

Currently we just do

    ml_anch = (prog->intflags & PREGf_ANCH_MBOL);

However, MBOL is also set on /.*..../; the two cases are distinguished by
adding the PREGf_IMPLICIT flag too.

So at the moment we have lots of tests along the lines of

    if (ml_anch && !(prog->intflags & PREGf_IMPLICIT))

Simplify this by adding the IMPLICIT condition when initially calculating
ml_anch, so there's no need to keep testing for it later. This also means
that ml_anch actually means what it says now.
regexec.c