diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-02-23 12:55:46 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-02-23 12:55:46 -0500 |
commit | cc70b2224d64ab38cbec569ff3df3dfde75bf017 (patch) | |
tree | 2846f5d0bf729cc9aa1ba598390f673deea157b0 /regex.c | |
parent | 85ee489c766bfcdd063d703bd1b596f25d3a0efe (diff) | |
download | bfs-cc70b2224d64ab38cbec569ff3df3dfde75bf017.tar.xz |
regex: Always set REG_STARTEND if available
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 } |