]> git.refcnt.org Git - colorize.git/commitdiff
Localize variable with name of existing file
authorSteven Schubiger <stsc@refcnt.org>
Fri, 4 Apr 2014 21:36:24 +0000 (23:36 +0200)
committerSteven Schubiger <stsc@refcnt.org>
Fri, 4 Apr 2014 21:36:24 +0000 (23:36 +0200)
colorize.c

index c12ce44fad7ca939e831ece31b7c3651080d42b7..b7974b1e7f721c284e9edbf5f7471d59860caca9 100644 (file)
@@ -507,14 +507,15 @@ process_args (unsigned int arg_cnt, char **arg_strings, bool *bold, const struct
 
         if (have_file)
           {
+            const char *file_exists = color_string;
             if (file_string)
-              vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), color_string, "cannot be used as color string");
+              vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), file_exists, "cannot be used as color string");
             else
               {
                 if (VALID_FILE_TYPE (mode))
-                  vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), color_string, "must be preceeded by color string");
+                  vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), file_exists, "must be preceeded by color string");
                 else
-                  vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), color_string, "is not a valid file type");
+                  vfprintf_fail (formats[FMT_QUOTE], get_file_type (mode), file_exists, "is not a valid file type");
               }
           }
       }