]> git.deb.at Git - pkg/abook.git/blobdiff - ui.c
Fix launch functions to preserve curses settings
[pkg/abook.git] / ui.c
diff --git a/ui.c b/ui.c
index c706963f86e550e26adaf18edcecb7e08257742c..9a19df7d9bc036261efa032d857adbe430346272 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -124,14 +124,22 @@ is_ui_initialized()
        return ui_initialized;
 }
 
-
-int
-init_ui()
+void
+ui_init_curses()
 {
-       initscr(); cbreak(); noecho();
+       if(!is_ui_initialized())
+               initscr();
+       cbreak();
+       noecho();
        nonl();
        intrflush(stdscr, FALSE);
        keypad(stdscr, TRUE);
+}
+
+int
+init_ui()
+{
+       ui_init_curses();
 #ifdef DEBUG
         fprintf(stderr, "init_abook():\n");
         fprintf(stderr, "  COLS = %d, LINES = %d\n", COLS, LINES);