calendar

BSD calendar reimplementation
git clone https://git.ce9e.org/calendar.git

commit
4925931536733fe1bb17b87617bc2319845f6b05
parent
50f46060f75fe9af70a81d2cc63166bc2c98a529
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-04-21 10:00
catch lines without \t

Diffstat

M calendar.c 5 ++++-

1 files changed, 4 insertions, 1 deletions


diff --git a/calendar.c b/calendar.c

@@ -311,7 +311,10 @@ struct line *get_lines(char *path) {
  311   311 	free(cmd);
  312   312 	while (fgets(s_line, sizeof(s_line) - 1, fp) != NULL) {
  313   313 		if (strlen(s_line) > 1) {
  314    -1 			if (!first) {
   -1   314 			if (!strchr(s_line, '\t')) {
   -1   315 				fprintf(stderr, "Error: Invalid line: %s\n", s_line);
   -1   316 				exit(1);
   -1   317 			} else if (!first) {
  315   318 				line = parse_line(s_line);
  316   319 				first = line;
  317   320 			} else {