about summary refs log tree commit diff
path: root/msed.c
diff options
context:
space:
mode:
Diffstat (limited to 'msed.c')
-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++;
 			}