aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-02-24 15:09:06 +0100
committerDuncaen <mail@duncano.de>2017-02-24 15:09:06 +0100
commit73c833847ee6e3353253633290003139f9e8f73f (patch)
treeccde3f6d7cc452b23a05ff601671b3f7c191fdac
parent8cd560fd4225f539174cb8dcf7bd482312d530d8 (diff)
downloadmblaze-73c833847ee6e3353253633290003139f9e8f73f.tar.gz
msed: error out on invalid expressions
-rw-r--r--msed.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/msed.c b/msed.c
index 5c82745..edb76ea 100644
--- a/msed.c
+++ b/msed.c
@@ -132,7 +132,13 @@ sed(char *file)
for (s = headersel; *s && *(s+1); s++)
if (*s == ':')
*s = '|';
- regcomp(&headerrx, headersel, REG_EXTENDED);
+ int rv;
+ if ((rv = regcomp(&headerrx, headersel, REG_EXTENDED)) != 0) {
+ char buf[100];
+ regerror(rv, &headerrx, buf, sizeof buf);
+ fprintf(stderr, "msed: %s\n", buf);
+ exit(1);
+ }
if (*e)
e++;
}