summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2021-03-09 17:03:38 +0000
committerDavid Mitchell <davem@iabyn.com>2021-03-09 17:03:38 +0000
commitcb174a785cca1bace5d049d08be208784028e671 (patch)
tree6eac94648f574d1a79e3c462212009773b650ace
parenta9bb6a62ae45bb372a5cca98a76d1a79edd89ccb (diff)
downloadperl-cb174a785cca1bace5d049d08be208784028e671.tar.gz
Perl_regexec_flags(): fixup code comments
One comment there since 5.000 had become meaningless, so remove it; add a couple of of other code comments to compensate.
-rw-r--r--regexec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 75d58ce8d4..452a298b9b 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3753,8 +3753,6 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
reginfo->info_aux_eval = reginfo->info_aux->info_aux_eval = NULL;
}
- /* If there is a "must appear" string, look for it. */
-
if (PL_curpm && (PM_GETRE(PL_curpm) == rx)) {
/* We have to be careful. If the previous successful match
was from this regex we don't want a subsequent partially
@@ -3779,8 +3777,8 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
if (prog->recurse_locinput)
Zero(prog->recurse_locinput,prog->nparens + 1, char *);
- /* Simplest case: anchored match need be tried only once, or with
- * MBOL, only at the beginning of each line.
+ /* Simplest case: anchored match (but not \G) need be tried only once,
+ * or with MBOL, only at the beginning of each line.
*
* Note that /.*.../ sets PREGf_IMPLICIT|MBOL, while /.*.../s sets
* PREGf_IMPLICIT|SBOL. The idea is that with /.*.../s, if it doesn't
@@ -3824,6 +3822,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
goto phooey;
} /* end anchored search */
+ /* anchored \G match */
if (prog->intflags & PREGf_ANCH_GPOS)
{
/* PREGf_ANCH_GPOS should never be true if PREGf_GPOS_SEEN is not true */
@@ -3838,6 +3837,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
}
/* Messy cases: unanchored match. */
+
if ((prog->anchored_substr || prog->anchored_utf8) && prog->intflags & PREGf_SKIP) {
/* we have /x+whatever/ */
/* it must be a one character string (XXXX Except is_utf8_pat?) */