X-Git-Url: http://git.refcnt.org/?p=colorize.git;a=blobdiff_plain;f=colorize.c;h=1e27fcae01878ea6f41c90adac3c52aa7138317b;hp=d947b92ffaa6bc7abc8668a4997fae14179dff3b;hb=13b184a21e6ede64a9cf16f20dd774ea8cd45c4f;hpb=cc5f2939f456022441fc70ee5ac430bbeeb00e3c diff --git a/colorize.c b/colorize.c index d947b92..1e27fca 100644 --- a/colorize.c +++ b/colorize.c @@ -468,7 +468,14 @@ process_opt_attr (const char *p) } } if (!valid_attr) - vfprintf_fail (formats[FMT_GENERIC], "--attr switch must be provided valid attribute names"); + { + char *sep; + char *attr_invalid = xstrdup (s); + STACK_VAR (attr_invalid); + if ((sep = strchr (attr_invalid, ','))) + *sep = '\0'; + vfprintf_fail ("--attr switch attribute '%s' is not valid", attr_invalid); + } } if (*p) p++; @@ -557,22 +564,23 @@ print_version (void) #endif const char *version_prefix, *version_string; const char *c_flags, *ld_flags, *cpp_flags; + const char *const desc_flags_unknown = "unknown"; struct bytes_size bytes_size; bool debug; #ifdef CFLAGS c_flags = to_str (CFLAGS); #else - c_flags = "unknown"; + c_flags = desc_flags_unknown; #endif #ifdef LDFLAGS ld_flags = to_str (LDFLAGS); #else - ld_flags = "unknown"; + ld_flags = desc_flags_unknown; #endif #ifdef CPPFLAGS cpp_flags = to_str (CPPFLAGS); #else - cpp_flags = "unknown"; + cpp_flags = desc_flags_unknown; #endif #if DEBUG debug = true;