X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=5ac1333b1c55ae969bfcf29d453ceed053a5ffc6;hp=dbe0a19ced1d1da9e2d588a2498dfc931371ee65;hb=481150224edabeee0a6bbfdab232df58e5c1224e;hpb=7a1764a24f86bd33beff864b52605ae739a65ca5 diff --git a/gui.c b/gui.c index dbe0a19c..5ac1333b 100644 --- a/gui.c +++ b/gui.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2010 Andre Noll + * Copyright (C) 1998-2011 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -294,9 +294,9 @@ static int align_str(WINDOW* win, char *str, unsigned int len, str[len] = '\0'; num = 0; } - /* replace newlines by spaces */ + /* replace control characters by spaces */ for (i = 0; i < len && str[i]; i++) { - if (str[i] == '\n') + if (str[i] == '\n' || str[i] == '\r' || str[i] == '\f') str[i] = ' '; } if (align == LEFT) { @@ -1394,17 +1394,8 @@ int main(int argc, char *argv[]) _argc = argc; _argv = argv; - if (gui_cmdline_parser(argc, argv, &conf)) { - fprintf(stderr, "parse error while reading command line\n"); - exit(EXIT_FAILURE); - } + gui_cmdline_parser(argc, argv, &conf); HANDLE_VERSION_FLAG("gui", conf); - init_theme(0, &theme); - top.lines = theme.top_lines_default; - if (check_key_map_args() < 0) { - fprintf(stderr, "invalid key map\n"); - exit(EXIT_FAILURE); - } cf = configfile_exists(); if (!cf && conf.config_file_given) { fprintf(stderr, "can not read config file %s\n", @@ -1422,9 +1413,11 @@ int main(int argc, char *argv[]) } loglevel = get_loglevel_by_name(conf.loglevel_arg); if (check_key_map_args() < 0) { - fprintf(stderr, "invalid key map in config file\n"); + fprintf(stderr, "invalid key map\n"); exit(EXIT_FAILURE); } + init_theme_or_die(conf.theme_arg, &theme); + top.lines = theme.top_lines_default; setup_signal_handling(); bot_win_rb = ringbuffer_new(RINGBUFFER_SIZE); initscr(); /* needed only once, always successful */