Add proper dflags
[apps/madmutt.git] / lib-ui / curs_lib.c
index 8e74153..c51f1a4 100644 (file)
@@ -211,7 +211,7 @@ void mutt_query_exit (void)
     wtimeout (stdscr, -1);               /* restore blocking operation */
   if (mutt_yesorno (_("Exit Madmutt?"), M_YES) == M_YES) {
     mutt_endwin (NULL);
-    exit (1);
+    mutt_exit(1);
   }
   mutt_clear_error ();
   mutt_curs_set (-1);
@@ -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();
@@ -316,12 +320,6 @@ void curses_initialize(void)
     meta(stdscr, true);
 }
 
-void _mutt_perror (const char *s, const char* filename, int line)
-{
-  char *p = strerror (errno);
-  mutt_error ("%s: %s (errno = %d) from %s:%i", s, p ? p : _("unknown error"), errno, filename, line);
-}
-
 /*
  * prompts the user to enter a keystroke, and displays the octal value back
  * to the user.