From 5b405827a2fa4c928c488f3e7b0197dfec60dcc2 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 29 Mar 2014 18:11:00 -0500 Subject: Group headers by standard (POSIX or LSB) or function (internationalization, networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix. --- lib/xwrap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/xwrap.c') diff --git a/lib/xwrap.c b/lib/xwrap.c index 51bd2b43..5310506c 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -514,3 +514,14 @@ long xparsetime(char *arg, long units, long *fraction) return l; } + +// Compile a regular expression into a regex_t +void xregcomp(regex_t *preg, char *regex, int cflags) +{ + int rc = regcomp(preg, regex, cflags); + + if (rc) { + regerror(rc, preg, libbuf, sizeof(libbuf)); + error_exit("xregcomp: %s", libbuf); + } +} -- cgit v1.2.3