From: Andre Noll Date: Mon, 12 May 2014 15:51:49 +0000 (+0200) Subject: gui: Always initialize theme. X-Git-Tag: v0.5.3~12^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=815bff104d37c61f65bc776eaeeb77f8a1406a1a 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. --- 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 */