diff options
author | Steven Schubiger <stsc@refcnt.org> | 2024-07-30 14:40:32 +0200 |
---|---|---|
committer | Steven Schubiger <stsc@refcnt.org> | 2024-07-30 14:40:32 +0200 |
commit | db8be3e9012423c6b64e6e4112396c2eae426dc5 (patch) | |
tree | 96f2017379576e895a0cb9714203519aa229052c /colorize.c | |
parent | 46921f49f5e5e68f75a0d08671147ea4edcc8b0b (diff) | |
download | colorize-db8be3e9012423c6b64e6e4112396c2eae426dc5.tar.gz colorize-db8be3e9012423c6b64e6e4112396c2eae426dc5.tar.bz2 |
Minor tweaks for rainbow mode
Diffstat (limited to 'colorize.c')
-rw-r--r-- | colorize.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -855,14 +855,12 @@ assign_conf (const char *conf_file, struct conf *config, const char *cfg, char * static void init_conf_vars (const char *conf_file, const struct conf *config) { - bool dummy; - if (config->attr) process_opt_attr (config->attr, false); if (config->exclude_random) process_opt_exclude_random (config->exclude_random, false); if (config->omit_color_empty) - init_conf_boolean (config->omit_color_empty, &omit_color_empty, "omit-color-empty", &dummy); + init_conf_boolean (config->omit_color_empty, &omit_color_empty, "omit-color-empty", NULL); if (config->rainbow_fg || config->rainbow_bg) { @@ -885,7 +883,9 @@ init_conf_boolean (const char *conf_var, bool *boolean_var, const char *name, bo *boolean_var = false; else vfprintf_fail (formats[FMT_CONF_INIT], name, "conf option is not valid"); - *seen_opt = true; + + if (seen_opt) + *seen_opt = true; } static void @@ -1154,8 +1154,7 @@ process_args (unsigned int arg_cnt, char **arg_strings, char *attr, const struct if (color_names[color] && ( streq (color_names[color]->name, "none") || streq (color_names[color]->name, "default")) - ) - { + ) { vfprintf_fail (formats[FMT_RAINBOW], tables[color].desc, color_names[color]->orig, "cannot be used with", rainbow_fg ? !rainbow_from_conf.fg ? "--rainbow-fg switch" : "rainbow-fg conf option" : !rainbow_from_conf.bg ? "--rainbow-bg switch" : "rainbow-bg conf option" |