diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2019-05-11 06:23:30 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2019-05-11 06:23:30 +0000 |
commit | 94d5ea5f6b6fea693d1c4a2ed3e81abd10220fe5 (patch) | |
tree | e24b00741c74bcaa55fce6fb737a947e6271cf20 /src | |
parent | 2051574efa08de08488810669b21d15f387aa3e8 (diff) | |
download | s6-94d5ea5f6b6fea693d1c4a2ed3e81abd10220fe5.tar.xz |
Accept empty regexes even on BSDs
Diffstat (limited to 'src')
-rw-r--r-- | src/daemontools-extras/s6-log.c | 2 | ||||
-rw-r--r-- | src/fdholder/s6-fdholderd.c | 5 | ||||
-rw-r--r-- | src/libs6/s6-ftrigrd.c | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c index c3360f4..16f6dd1 100644 --- a/src/daemontools-extras/s6-log.c +++ b/src/daemontools-extras/s6-log.c @@ -786,7 +786,7 @@ static inline void script_secondpass (char const *const *argv, scriptelem_t *scr sel_t selitem = { .type = (*argv)[0] != 'f' ? (*argv)[0] == '+' ? SELTYPE_PLUS : SELTYPE_MINUS : SELTYPE_DEFAULT } ; if ((*argv)[0] != 'f') { - int r = regcomp(&selitem.re, *argv + 1, REG_EXTENDED | REG_NOSUB | REG_NEWLINE) ; + int r = skalibs_regcomp(&selitem.re, *argv + 1, REG_EXTENDED | REG_NOSUB | REG_NEWLINE) ; if (r == REG_ESPACE) { errno = ENOMEM ; diff --git a/src/fdholder/s6-fdholderd.c b/src/fdholder/s6-fdholderd.c index 2f4c2b4..86a957a 100644 --- a/src/fdholder/s6-fdholderd.c +++ b/src/fdholder/s6-fdholderd.c @@ -11,6 +11,7 @@ #include <signal.h> #include <regex.h> +#include <skalibs/posixplz.h> #include <skalibs/posixishard.h> #include <skalibs/types.h> #include <skalibs/allreadwrite.h> @@ -528,7 +529,7 @@ static int makere (regex_t *re, char const *s, char const *var) size_t varlen = strlen(var) ; if (str_start(s, var) && (s[varlen] == '=')) { - int r = regcomp(re, s + varlen + 1, REG_EXTENDED | REG_NOSUB) ; + int r = skalibs_regcomp(re, s + varlen + 1, REG_EXTENDED | REG_NOSUB) ; if (r) { if (verbosity) @@ -546,7 +547,7 @@ static int makere (regex_t *re, char const *s, char const *var) static void defaultre (regex_t *re) { - int r = regcomp(re, ".^", REG_EXTENDED | REG_NOSUB) ; + int r = skalibs_regcomp(re, ".^", REG_EXTENDED | REG_NOSUB) ; if (r) { char buf[256] ; diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c index e79ae46..dfb9672 100644 --- a/src/libs6/s6-ftrigrd.c +++ b/src/libs6/s6-ftrigrd.c @@ -7,6 +7,7 @@ #include <signal.h> #include <regex.h> +#include <skalibs/posixplz.h> #include <skalibs/posixishard.h> #include <skalibs/types.h> #include <skalibs/allreadwrite.h> @@ -160,7 +161,7 @@ static int parse_protocol (struct iovec const *v, void *context) answer(ENFILE) ; break ; } - r = regcomp(&a[n].re, s + 16 + pathlen, REG_EXTENDED) ; + r = skalibs_regcomp(&a[n].re, s + 16 + pathlen, REG_EXTENDED) ; if (r) { answer(r == REG_ESPACE ? ENOMEM : EINVAL) ; |