From 5337d33cc6e46a6eb281f2abb325b29c882a82b2 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 27 Jun 2026 21:07:50 +0200 Subject: fixup REG_ANCHORED: the checks have to be in shortest() I put them into longest() as well, but it appears that both find() and cfind() will always try shortest() first and should abort if that returns NULL. --- regexec.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'regexec.c') diff --git a/regexec.c b/regexec.c index 848d911..d047929 100644 --- a/regexec.c +++ b/regexec.c @@ -415,9 +415,6 @@ find( if (end != NULL) { break; /* NOTE BREAK OUT */ } - if (v->eflags & REG_ANCHORED) { - break; /* NOTE BREAK OUT */ - } } assert(end != NULL); /* search RE succeeded so loop should */ freedfa(d); @@ -581,9 +578,6 @@ cfindloop( estop = prevchr(v, end); } } - if (v->eflags & REG_ANCHORED) { - break; /* NOTE BREAK OUT */ - } } } while (close < v->stop); -- cgit v1.2.3