kconfig/mconf.c: revision of curses initialization.
authorDirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
Mon, 6 Aug 2012 14:48:23 +0000 (16:48 +0200)
committerMichal Marek <mmarek@suse.cz>
Thu, 30 Aug 2012 12:47:34 +0000 (14:47 +0200)
Since commit d0e1e09568 initscr() is called twice in mconf.

Do it only in init_dialog() in util.c and there also save the
cursor position for the signal handler in mconf.c.

Signed-off-by: Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/kconfig/lxdialog/dialog.h
scripts/kconfig/lxdialog/util.c
scripts/kconfig/mconf.c

index b5211fce0d946ab90eaf1ba239f3b20b40039b11..43a58ec09cd471aa48e01f6f5ef7911edbee51ab 100644 (file)
@@ -144,6 +144,7 @@ struct dialog_info {
  */
 extern struct dialog_info dlg;
 extern char dialog_input_result[];
+extern int saved_x, saved_y;           /* Needed in signal handler in mconf.c */
 
 /*
  * Function prototypes
index f2375ad7ebc9bf07d306fc8de611f631b36cd7bf..109d53117d223682254502b51b6414d7404852e2 100644 (file)
@@ -23,6 +23,9 @@
 
 #include "dialog.h"
 
+/* Needed in signal handler in mconf.c */
+int saved_x, saved_y;
+
 struct dialog_info dlg;
 
 static void set_mono_theme(void)
@@ -273,6 +276,10 @@ int init_dialog(const char *backtitle)
        int height, width;
 
        initscr();              /* Init curses */
+
+       /* Get current cursor position for signal handler in mconf.c */
+       getyx(stdscr, saved_y, saved_x);
+
        getmaxyx(stdscr, height, width);
        if (height < 19 || width < 80) {
                endwin();
index f584a281bb4c94d240b135ba6943fe75a433b3ec..d856d40869e6027f1b0aa56b833691c2445d8569 100644 (file)
@@ -273,7 +273,6 @@ static struct menu *current_menu;
 static int child_count;
 static int single_menu_mode;
 static int show_all_options;
-static int saved_x, saved_y;
 
 static void conf(struct menu *menu);
 static void conf_choice(struct menu *menu);
@@ -862,9 +861,6 @@ int main(int ac, char **av)
                        single_menu_mode = 1;
        }
 
-       initscr();
-
-       getyx(stdscr, saved_y, saved_x);
        if (init_dialog(NULL)) {
                fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
                fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
This page took 0.02575 seconds and 5 git commands to generate.