diff options
author | Steven Schubiger <stsc@refcnt.org> | 2020-12-17 22:46:38 +0100 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2020-12-17 22:46:38 +0100 |
commit | ae049342a1a513093ba4f3f56af2194ef2707da0 (patch) | |
tree | f66b5bd0ee73e04dc638f3c0baf8f7e0fe4db0d2 /colorize.c | |
parent | da7aeb5522d20e93de866cfa236b996b96129884 (diff) | |
download | colorize-ae049342a1a513093ba4f3f56af2194ef2707da0.tar.gz colorize-ae049342a1a513093ba4f3f56af2194ef2707da0.tar.bz2 |
Emit more concise error message when config file does not exist
Diffstat (limited to 'colorize.c')
-rw-r--r-- | colorize.c | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -192,18 +192,20 @@ enum { FMT_ERROR, FMT_FILE, FMT_TYPE, - FMT_CONF + FMT_CONF, + FMT_CONF_FILE }; static const char *formats[] = { - "%s", /* generic */ - "%s '%s'", /* string */ - "%s `%s' %s", /* quote */ - "%s color '%s' %s", /* color */ - "%s color '%s' %s '%s'", /* random */ - "less than %lu bytes %s", /* error */ - "%s: %s", /* file */ - "%s: %s: %s", /* type */ - "%s: option '%s' %s" /* conf */ + "%s", /* generic */ + "%s '%s'", /* string */ + "%s `%s' %s", /* quote */ + "%s color '%s' %s", /* color */ + "%s color '%s' %s '%s'", /* random */ + "less than %lu bytes %s", /* error */ + "%s: %s", /* file */ + "%s: %s: %s", /* type */ + "%s: option '%s' %s", /* conf */ + "config file %s: %s" /* conf file */ }; enum { GENERIC, FOREGROUND = 0, BACKGROUND }; @@ -391,7 +393,7 @@ main (int argc, char **argv) } errno = 0; if (access (conf_file, F_OK) == -1) - vfprintf_fail (formats[FMT_FILE], conf_file, strerror (errno)); + vfprintf_fail (formats[FMT_CONF_FILE], conf_file, strerror (errno)); } #endif #if defined(CONF_FILE_TEST) || !defined(TEST) |