X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=gui.c;h=5b25c51bee99fa5ad3707a72fa012e4479983dee;hb=7a115f007020abedf07ab71ef17d0d07df1a55f8;hp=dbe0a19ced1d1da9e2d588a2498dfc931371ee65;hpb=9b565c60fd159e12d255bb18db9dbff066deebea;p=paraslash.git diff --git a/gui.c b/gui.c index dbe0a19c..5b25c51b 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) { @@ -1399,8 +1399,6 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } 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); @@ -1425,6 +1423,8 @@ int main(int argc, char *argv[]) fprintf(stderr, "invalid key map in config file\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 */