aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorDirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>2012-08-06 10:48:23 -0400
committerMichal Marek <mmarek@suse.cz>2012-08-30 08:47:34 -0400
commit3eb95c84ee594d4a4e5a8c37b01464cff4762c96 (patch)
tree9a23135c58138bbe871258bee71d41c60caf1868 /scripts/kconfig
parent0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff)
kconfig/mconf.c: revision of curses initialization.
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>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/lxdialog/dialog.h1
-rw-r--r--scripts/kconfig/lxdialog/util.c7
-rw-r--r--scripts/kconfig/mconf.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index b5211fce0d94..43a58ec09cd4 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -144,6 +144,7 @@ struct dialog_info {
144 */ 144 */
145extern struct dialog_info dlg; 145extern struct dialog_info dlg;
146extern char dialog_input_result[]; 146extern char dialog_input_result[];
147extern int saved_x, saved_y; /* Needed in signal handler in mconf.c */
147 148
148/* 149/*
149 * Function prototypes 150 * Function prototypes
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index f2375ad7ebc9..109d53117d22 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -23,6 +23,9 @@
23 23
24#include "dialog.h" 24#include "dialog.h"
25 25
26/* Needed in signal handler in mconf.c */
27int saved_x, saved_y;
28
26struct dialog_info dlg; 29struct dialog_info dlg;
27 30
28static void set_mono_theme(void) 31static void set_mono_theme(void)
@@ -273,6 +276,10 @@ int init_dialog(const char *backtitle)
273 int height, width; 276 int height, width;
274 277
275 initscr(); /* Init curses */ 278 initscr(); /* Init curses */
279
280 /* Get current cursor position for signal handler in mconf.c */
281 getyx(stdscr, saved_y, saved_x);
282
276 getmaxyx(stdscr, height, width); 283 getmaxyx(stdscr, height, width);
277 if (height < 19 || width < 80) { 284 if (height < 19 || width < 80) {
278 endwin(); 285 endwin();
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index f584a281bb4c..d856d40869e6 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -273,7 +273,6 @@ static struct menu *current_menu;
273static int child_count; 273static int child_count;
274static int single_menu_mode; 274static int single_menu_mode;
275static int show_all_options; 275static int show_all_options;
276static int saved_x, saved_y;
277 276
278static void conf(struct menu *menu); 277static void conf(struct menu *menu);
279static void conf_choice(struct menu *menu); 278static void conf_choice(struct menu *menu);
@@ -862,9 +861,6 @@ int main(int ac, char **av)
862 single_menu_mode = 1; 861 single_menu_mode = 1;
863 } 862 }
864 863
865 initscr();
866
867 getyx(stdscr, saved_y, saved_x);
868 if (init_dialog(NULL)) { 864 if (init_dialog(NULL)) {
869 fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); 865 fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
870 fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); 866 fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));