From: Pierre Habouzit Date: Wed, 15 Aug 2007 13:59:40 +0000 (+0200) Subject: Simplifications. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=4c86444ebf9fc4a8231424c0cdd832eb10abdb35;p=apps%2Fmadmutt.git Simplifications. Signed-off-by: Pierre Habouzit --- diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index 18216ab..c51f1a4 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -308,6 +308,10 @@ void mutt_show_error (void) void curses_initialize(void) { + if (initscr () == NULL) { + puts _("Error initializing terminal."); + exit (1); + } ci_start_color(); keypad(stdscr, true); cbreak(); diff --git a/main.c b/main.c index c2d06c5..f53dc03 100644 --- a/main.c +++ b/main.c @@ -180,27 +180,12 @@ static void show_version (void) exit(0); } -static void start_curses (void) -{ - km_init (); /* must come before mutt_init */ - mutt_signal_initialize (); - if (initscr () == NULL) { - puts _("Error initializing terminal."); - - exit (1); - } - mutt_signal_initialize (); - curses_initialize(); -} - #define M_IGNORE (1<<0) /* -z */ #define M_BUFFY (1<<1) /* -Z */ #define M_NOSYSRC (1<<2) /* -n */ #define M_RO (1<<3) /* -R */ #define M_SELECT (1<<4) /* -y */ -#ifdef USE_NNTP #define M_NEWS (1<<5) /* -g and -G */ -#endif __attribute__((format(printf, 1, 0))) static void mutt_nocurses_error (const char *fmt, ...) @@ -357,8 +342,11 @@ int main (int argc, char **argv) /* This must come before mutt_init() because curses needs to be started before calling the init_pair() function to set the color scheme. */ - if (!option (OPTNOCURSES)) - start_curses(); + if (!option (OPTNOCURSES)) { + km_init(); + curses_initialize(); + mutt_signal_initialize(); + } /* set defaults and read init files */ mutt_init (flags & M_NOSYSRC, commands);