From 911b4761e465ec084acc7e14ca18dfe5e9b8a00a Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 12 Jan 2021 19:00:12 -0500 Subject: Split fields by tab only Also don't fail hard on non-forward-search definitions. --- bin/htagml.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/htagml.c b/bin/htagml.c index 6f2de596..670b74dd 100644 --- a/bin/htagml.c +++ b/bin/htagml.c @@ -90,12 +90,13 @@ int main(int argc, char *argv[]) { size_t bufCap = 0; while (0 < getline(&buf, &bufCap, file)) { char *line = buf; - char *tag = strsep(&line, "\t "); - char *file = strsep(&line, "\t "); + char *tag = strsep(&line, "\t"); + char *file = strsep(&line, "\t"); char *search = strsep(&line, "\n"); if (!tag || !file || !search) errx(EX_DATAERR, "malformed tags file"); if (search[0] != '/' || search[strlen(search)-1] != '/') { - errx(EX_DATAERR, "search is not forward regex: %s", search); + warnx("tag %s definition is not a forward search: %s", tag, search); + continue; } search++; search[strlen(search)-1] = '\0'; -- cgit 1.4.1