]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
gui: Always initialize theme.
authorAndre Noll <maan@systemlinux.org>
Mon, 12 May 2014 15:51:49 +0000 (17:51 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 12 May 2014 15:59:14 +0000 (17:59 +0200)
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

diff --git a/gui.c b/gui.c
index c5adddb2fa002e92ba9368e99355e695102bf0de..b077b00aa9dd08a5c01dbdec06003781013d11cb 100644 (file)
--- 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, &params);
        loglevel = get_loglevel_by_name(conf.loglevel_arg);
        check_key_map_args_or_die();
        gui_cmdline_parser_config_file(config_file, &conf, &params);
        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);
        err = false;
 out:
        free(config_file);
        if (err)
                exit(EXIT_FAILURE);
+       theme_init(conf.theme_arg, &theme);
 }
 
 /* reread configuration, terminate on errors */
 }
 
 /* reread configuration, terminate on errors */