summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-12 19:00:12 -0500
committerJune McEnroe <june@causal.agency>2021-01-12 19:00:12 -0500
commit4bd6bb0f36f1e234a6aa8f1cd3d2660c9888b838 (patch)
tree3532790725f1c8685b1bbc37e96f384853525695
parentList both Makefile and html.sh under README.7 (diff)
downloadsrc-4bd6bb0f36f1e234a6aa8f1cd3d2660c9888b838.tar.gz
src-4bd6bb0f36f1e234a6aa8f1cd3d2660c9888b838.zip
Split fields by tab only
Also don't fail hard on non-forward-search definitions.
-rw-r--r--bin/htagml.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/htagml.c b/bin/htagml.c
index 22d921a4..8cc2272c 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';