From 71e65bb036c53777a973553cd001adb26e40a84b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 25 Jun 1996 04:26:01 +0000 Subject: (dc_parse_stream): Give `unrecognized keyword' for misspelled `TERM' keyword as well as for others. --- src/dircolors.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dircolors.c b/src/dircolors.c index b2b409686..82c706168 100644 --- a/src/dircolors.c +++ b/src/dircolors.c @@ -248,6 +248,7 @@ dc_parse_stream (FILE *fp, const char *filename, char **result) { int line_length; char *keywd, *arg; + int unrecognized; ++line_number; @@ -274,6 +275,7 @@ dc_parse_stream (FILE *fp, const char *filename, char **result) if (keywd == NULL) continue; + unrecognized = 0; if (strcasecmp (keywd, "TERM") == 0) { if (strcmp (arg, term) == 0) @@ -326,13 +328,23 @@ dc_parse_stream (FILE *fp, const char *filename, char **result) } else { - error (0, 0, _("%s:%lu: unrecognized keyword %s"), - filename, (long unsigned) line_number, keywd); - err = 1; + unrecognized = 1; } } } + else + { + unrecognized = 1; + } } + + if (unrecognized) + { + error (0, 0, _("%s:%lu: unrecognized keyword `%s'"), + filename, (long unsigned) line_number, keywd); + err = 1; + } + free (keywd); if (arg) free (arg); -- cgit v1.2.3-70-g09d2