mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 73c833847ee6e3353253633290003139f9e8f73f
parent 8cd560fd4225f539174cb8dcf7bd482312d530d8
Author: Duncaen <mail@duncano.de>
Date:   Fri, 24 Feb 2017 15:09:06 +0100

msed: error out on invalid expressions

Diffstat:
msed.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 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++; }