Skip to content

Commit

Permalink
kconfig: fix undesirable side effect of adding "visible" menu attribute
Browse files Browse the repository at this point in the history
This lead to non-selected, non-user-selectable options to be written
out to .config. This is not only pointless, but also preventing the
user to be prompted should any of those options eventually become
visible (e.g. by de-selecting the *_AUTO options the "visible"
attribute was added for.

Furthermore it is quite logical for the "visible" attribute of a menu
to control the visibility of all contained prompts, which is what the
patch does.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
Jan Beulich authored and Michal Marek committed Dec 29, 2010
1 parent 3079910 commit 7ad1227
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
@@ -140,6 +140,20 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
}
if (current_entry->prompt && current_entry != &rootmenu)
prop_warn(prop, "prompt redefined");

/* Apply all upper menus' visibilities to actual prompts. */
if(type == P_PROMPT) {
struct menu *menu = current_entry;

while ((menu = menu->parent) != NULL) {
if (!menu->visibility)
continue;
prop->visible.expr
= expr_alloc_and(prop->visible.expr,
menu->visibility);
}
}

current_entry->prompt = prop;
}
prop->text = prompt;

0 comments on commit 7ad1227

Please sign in to comment.