From 815bff104d37c61f65bc776eaeeb77f8a1406a1a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 12 May 2014 17:51:49 +0200 Subject: [PATCH] gui: Always initialize theme. parse_config_file_or_die() contains the following bug: If the configuration file ~/.paraslash/gui.conf does not exist, the current code not only skips the gengetopt config file parser (which is correct) but also omits to call theme_init(), which is incorrect. The bug was introduced recently in commit 18d37e (Unify config file parsing). Fix it by moving the call to theme_init() to the bottom of the function so that it is called if and only if parse_config_file_or_die() succeeds. --- gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui.c b/gui.c index c5adddb2..b077b00a 100644 --- a/gui.c +++ b/gui.c @@ -873,12 +873,12 @@ static void parse_config_file_or_die(bool override) gui_cmdline_parser_config_file(config_file, &conf, ¶ms); loglevel = get_loglevel_by_name(conf.loglevel_arg); check_key_map_args_or_die(); - theme_init(conf.theme_arg, &theme); err = false; out: free(config_file); if (err) exit(EXIT_FAILURE); + theme_init(conf.theme_arg, &theme); } /* reread configuration, terminate on errors */ -- 2.39.5