From: Andre Noll Date: Tue, 7 Jan 2014 15:59:27 +0000 (+0000) Subject: gui: Parse command line options only once. X-Git-Tag: v0.5.3~12^2~26 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=997ddacf9fcfc21a79304c316d7143de0cb3df9d;p=paraslash.git gui: Parse command line options only once. There is no point in calling gui_cmdline_parser_ext() when rereading the configuration since this parser only looks at the command line options which never change. Removing the call in com_reread_conf() also allows to get rid of the global _argc and _argv variables. --- diff --git a/gui.c b/gui.c index 96043da0..57e922b0 100644 --- a/gui.c +++ b/gui.c @@ -84,9 +84,6 @@ struct gui_command { static struct gui_theme theme; -static int _argc; -static char **_argv; - static void com_help(void); static void com_reread_conf(void); static void com_enlarge_top_win(void); @@ -1306,7 +1303,6 @@ static void com_reread_conf(void) return; } PARA_INFO_LOG("rereading command line options and config file\n"); - gui_cmdline_parser_ext(_argc, _argv, &conf, ¶ms); /* * Despite .print_errors is set to 0, gengetopt will print to stderr * anyway, and exit on errors. So we have to shutdown curses first. @@ -1462,9 +1458,6 @@ int main(int argc, char *argv[]) int ret; char *cf; - _argc = argc; - _argv = argv; - gui_cmdline_parser(argc, argv, &conf); /* exits on errors */ loglevel = get_loglevel_by_name(conf.loglevel_arg); version_handle_flag("gui", conf.version_given);