From e7be007842ead65b244f767219e9c541e78781b4 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Sun, 12 Jan 2020 22:20:37 -0800 Subject: [PATCH] The color and style config options now have the same semantics as the command line options --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 12fc20b..dff1b00 100644 --- a/src/main.c +++ b/src/main.c @@ -488,10 +488,13 @@ int main(int argc, char** argv) { } free(config_path); + if(style_str == NULL) { + style_str = map_get(config, "style"); + } + //Check if --style was specified if(style_str == NULL) { style_str = map_get(config, "stylesheet"); - style_str = style_str == NULL ? map_get(config, "style") : style_str; if(style_str == NULL) { const char* style_f = "/style.css"; stylesheet = utils_concat(2, CONFIG_LOCATION, style_f); @@ -506,10 +509,13 @@ int main(int argc, char** argv) { stylesheet = strdup(style_str); } + if(color_str == NULL) { + color_str = map_get(config, "color"); + } + //Check if --color was specified if(color_str == NULL) { color_str = map_get(config, "colors"); - color_str = color_str == NULL ? map_get(config, "color") : color_str; if(color_str == NULL) { color_path = strdup(COLORS_LOCATION); } else {