From 7ba291037b1dbd0cd205ba07e6444293596a3761 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 20 Apr 2016 23:33:31 +0100 Subject: move regex helper to be with teh single remaining call site --- utils/utils.c | 16 ---------------- utils/utils.h | 8 -------- 2 files changed, 24 deletions(-) (limited to 'utils') diff --git a/utils/utils.c b/utils/utils.c index 37839dc48..19d5bf0d6 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -217,21 +216,6 @@ nserror snstrjoin(char **str, size_t *size, char sep, size_t nelm, ...) } -/* exported interface documented in utils/utils.h */ -nserror regcomp_wrapper(regex_t *preg, const char *regex, int cflags) -{ - int r; - r = regcomp(preg, regex, cflags); - if (r) { - char errbuf[200]; - regerror(r, preg, errbuf, sizeof errbuf); - LOG("Failed to compile regexp '%s': %s\n", regex, errbuf); - return NSERROR_INIT_FAILED; - } - return NSERROR_OK; -} - - /** * The size of buffers within human_friendly_bytesize. * diff --git a/utils/utils.h b/utils/utils.h index 5fa521c01..6121ebe44 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -152,13 +151,6 @@ char *cnv_space2nbsp(const char *s); */ bool is_dir(const char *path); -/** - * Compile a regular expression, handling errors. - * - * Parameters as for regcomp(), see man regex. - */ -nserror regcomp_wrapper(regex_t *preg, const char *regex, int cflags); - /** * Create a human redable representation of a size in bytes. * -- cgit v1.2.3