From: Steven Schubiger Date: Mon, 28 Jan 2013 19:10:22 +0000 (+0100) Subject: Enhance message if color string exists as file X-Git-Tag: v0.49~10 X-Git-Url: http://git.refcnt.org/?p=colorize.git;a=commitdiff_plain;h=0802a010b347abd0172beb4411cd2b6af946f73b Enhance message if color string exists as file --- diff --git a/colorize.c b/colorize.c index 041ecdb..2f02bf4 100644 --- a/colorize.c +++ b/colorize.c @@ -403,7 +403,12 @@ process_options (unsigned int arg_cnt, char **option_strings, bool *bold, const have_file = (*color != '\0'); if (have_file) - vfprintf_fail (formats[FMT_GENERIC], "file must be preceeded by color string"); + { + if (file_string) + vfprintf_fail (formats[FMT_GENERIC], "file cannot be used as color string"); + else + vfprintf_fail (formats[FMT_GENERIC], "file must be preceeded by color string"); + } } if ((p = strchr (color_string, '/')))