aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/lxdialog/menubox.c9
-rw-r--r--scripts/kconfig/mconf.c11
-rw-r--r--scripts/kconfig/menu.c15
3 files changed, 25 insertions, 10 deletions
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 48d382e7e374..38cd69c5660e 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -303,10 +303,11 @@ do_resize:
303 } 303 }
304 } 304 }
305 305
306 if (i < max_choice || 306 if (item_count() != 0 &&
307 key == KEY_UP || key == KEY_DOWN || 307 (i < max_choice ||
308 key == '-' || key == '+' || 308 key == KEY_UP || key == KEY_DOWN ||
309 key == KEY_PPAGE || key == KEY_NPAGE) { 309 key == '-' || key == '+' ||
310 key == KEY_PPAGE || key == KEY_NPAGE)) {
310 /* Remove highligt of current item */ 311 /* Remove highligt of current item */
311 print_item(scroll + choice, choice, FALSE); 312 print_item(scroll + choice, choice, FALSE);
312 313
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 387dc8daf7b2..a69cbd78fb38 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -670,11 +670,12 @@ static void conf(struct menu *menu, struct menu *active_menu)
670 active_menu, &s_scroll); 670 active_menu, &s_scroll);
671 if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) 671 if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
672 break; 672 break;
673 if (!item_activate_selected()) 673 if (item_count() != 0) {
674 continue; 674 if (!item_activate_selected())
675 if (!item_tag()) 675 continue;
676 continue; 676 if (!item_tag())
677 677 continue;
678 }
678 submenu = item_data(); 679 submenu = item_data();
679 active_menu = item_data(); 680 active_menu = item_data();
680 if (submenu) 681 if (submenu)
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b5c7d90df9df..fd3f0180e08f 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -146,11 +146,24 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
146 struct menu *menu = current_entry; 146 struct menu *menu = current_entry;
147 147
148 while ((menu = menu->parent) != NULL) { 148 while ((menu = menu->parent) != NULL) {
149 struct expr *dup_expr;
150
149 if (!menu->visibility) 151 if (!menu->visibility)
150 continue; 152 continue;
153 /*
154 * Do not add a reference to the
155 * menu's visibility expression but
156 * use a copy of it. Otherwise the
157 * expression reduction functions
158 * will modify expressions that have
159 * multiple references which can
160 * cause unwanted side effects.
161 */
162 dup_expr = expr_copy(menu->visibility);
163
151 prop->visible.expr 164 prop->visible.expr
152 = expr_alloc_and(prop->visible.expr, 165 = expr_alloc_and(prop->visible.expr,
153 menu->visibility); 166 dup_expr);
154 } 167 }
155 } 168 }
156 169