summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-02-04 11:23:27 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-02-04 11:28:22 -0500
commit2d4d6787c4bc62042be4a58a4791074ab2c6a89e (patch)
tree0753c783533afc2bc3362f73ba3e8c2e45f1e65b /util.c
parentd83ffb41c7f5d42bfb43a19e38ab3d1331f0d86e (diff)
downloadbfs-2d4d6787c4bc62042be4a58a4791074ab2c6a89e.tar.xz
regex: Add support for emacs and grep types
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/util.c b/util.c
index e737c09..9f74e5a 100644
--- a/util.c
+++ b/util.c
@@ -115,15 +115,6 @@ int pipe_cloexec(int pipefd[2]) {
#endif
}
-char *xregerror(int err, const regex_t *regex) {
- size_t len = regerror(err, regex, NULL, 0);
- char *str = malloc(len);
- if (str) {
- regerror(err, regex, str, len);
- }
- return str;
-}
-
/** Get the single character describing the given file type. */
static char type_char(mode_t mode) {
switch (mode & S_IFMT) {
@@ -273,7 +264,7 @@ static int xrpregex(nl_item item, const char *response) {
}
regex_t regex;
- int ret = regcomp(&regex, pattern, REG_EXTENDED);
+ int ret = bfs_regcomp(&regex, pattern, 0, BFS_REGEX_POSIX_EXTENDED);
if (ret != 0) {
return ret;
}