aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xregcomp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/xregcomp.c b/libbb/xregcomp.c
index 4bcb9aedf..6e9a29f49 100644
--- a/libbb/xregcomp.c
+++ b/libbb/xregcomp.c
@@ -8,16 +8,13 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
9 */ 9 */
10 10
11#include <stdio.h>
12#include "libbb.h" 11#include "libbb.h"
13#include "xregex.h" 12#include "xregex.h"
14 13
15
16
17void xregcomp(regex_t *preg, const char *regex, int cflags) 14void xregcomp(regex_t *preg, const char *regex, int cflags)
18{ 15{
19 int ret; 16 int ret = regcomp(preg, regex, cflags);
20 if ((ret = regcomp(preg, regex, cflags)) != 0) { 17 if (ret) {
21 int errmsgsz = regerror(ret, preg, NULL, 0); 18 int errmsgsz = regerror(ret, preg, NULL, 0);
22 char *errmsg = xmalloc(errmsgsz); 19 char *errmsg = xmalloc(errmsgsz);
23 regerror(ret, preg, errmsg, errmsgsz); 20 regerror(ret, preg, errmsg, errmsgsz);