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;
{
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"
}
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();