From cc70b2224d64ab38cbec569ff3df3dfde75bf017 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 23 Feb 2022 12:55:46 -0500 Subject: regex: Always set REG_STARTEND if available --- regex.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/regex.c b/regex.c index fee25ad..3a14b25 100644 --- a/regex.c +++ b/regex.c @@ -152,9 +152,7 @@ bool bfs_regexec(struct bfs_regex *regex, const char *str, enum bfs_regexec_flag int eflags = 0; #ifdef REG_STARTEND - if (flags & BFS_REGEX_ANCHOR) { - eflags |= REG_STARTEND; - } + eflags |= REG_STARTEND; #endif int ret = regexec(®ex->impl, str, 1, &match, eflags); @@ -167,11 +165,11 @@ bool bfs_regexec(struct bfs_regex *regex, const char *str, enum bfs_regexec_flag } } else if (ret == REG_NOMATCH) { *err = 0; - return false; } else { *err = ret; - return false; } + + return false; #endif } -- cgit v1.2.3