Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.c
[oweals/busybox.git] / utility.c
index 6d1e1d4bbc40b3e08c0de14373b920f407e12be1..61f67618d80cad705bd1a84636b2b613b3bb0b26 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -1722,18 +1722,15 @@ char *get_last_path_component(char *path)
 #endif
 
 #if defined BB_GREP || defined BB_SED
-int bb_regcomp(regex_t *preg, const char *regex, int cflags)
+void xregcomp(regex_t *preg, const char *regex, int cflags)
 {
        int ret;
        if ((ret = regcomp(preg, regex, cflags)) != 0) {
                int errmsgsz = regerror(ret, preg, NULL, 0);
                char *errmsg = xmalloc(errmsgsz);
                regerror(ret, preg, errmsg, errmsgsz);
-               errorMsg("bb_regcomp: %s\n", errmsg);
-               free(errmsg);
-               regfree(preg);
+               fatalError("bb_regcomp: %s\n", errmsg);
        }
-       return ret;
 }
 #endif