summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-02-23 12:55:46 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-02-23 12:55:46 -0500
commitcc70b2224d64ab38cbec569ff3df3dfde75bf017 (patch)
tree2846f5d0bf729cc9aa1ba598390f673deea157b0 /regex.c
parent85ee489c766bfcdd063d703bd1b596f25d3a0efe (diff)
downloadbfs-cc70b2224d64ab38cbec569ff3df3dfde75bf017.tar.xz
regex: Always set REG_STARTEND if available
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c8
1 files 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(&regex->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
}