X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=9d96e70f6949362b39b50fa1dc23e85327a9316a;hp=c82cd8c32300b27d2bd6c5a8d15bff60e52fb372;hb=16181209926798db9004f43ba9261c476a36b6bf;hpb=30741f9f15db7c4681755c1234d8c4335013a487 diff --git a/gui.c b/gui.c index c82cd8c3..9d96e70f 100644 --- a/gui.c +++ b/gui.c @@ -296,7 +296,7 @@ static int align_str(WINDOW* win, char *str, unsigned int len, waddstr(win, str); } else { add_spaces(win, num / 2); - waddstr(win, str[0]? str: ""); + waddstr(win, str); add_spaces(win, num - num / 2); } return 1; @@ -776,7 +776,7 @@ static void init_curses(void) { if (curses_active()) return; - if (top.win && refresh() == ERR) /* refresh is really needed */ + if (refresh() == ERR) /* refresh is really needed */ die(EXIT_FAILURE, "refresh() failed\n"); if (LINES < theme.lines_min || COLS < theme.cols_min) die(EXIT_FAILURE, "Terminal (%dx%d) too small" @@ -871,6 +871,23 @@ static void parse_config_file_or_die(bool override) } goto out; } + /* + * When the gengetopt config file parser is called more than once, any + * key map arguments found in the config file are _appended_ to the old + * values, even though we turn on ->override. We want the new arguments + * to replace the old ones, so we must empty the key_map_arg array + * first. Unfortunately, this also clears any key map arguments given + * at the command line. + */ + if (override) { + int i; + for (i = 0; i < conf.key_map_given; i++) { + free(conf.key_map_arg[i]); + conf.key_map_arg[i] = NULL; + } + conf.key_map_given = 0; + } + gui_cmdline_parser_config_file(config_file, &conf, ¶ms); loglevel = get_loglevel_by_name(conf.loglevel_arg); check_key_map_args_or_die();