diff options
author | Jim Meyering <jim@meyering.net> | 1996-06-25 04:26:01 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-06-25 04:26:01 +0000 |
commit | 71e65bb036c53777a973553cd001adb26e40a84b (patch) | |
tree | 65fa619d1989ad7f9eace3ebb44d66a5591faed8 /src | |
parent | 522141076e763f5dda96f57bc1437799b2aa63f5 (diff) | |
download | coreutils-71e65bb036c53777a973553cd001adb26e40a84b.tar.xz |
(dc_parse_stream): Give `unrecognized keyword' for misspelled
`TERM' keyword as well as for others.
Diffstat (limited to 'src')
-rw-r--r-- | src/dircolors.c | 18 |
1 files changed, 15 insertions, 3 deletions
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); |