diff options
author | Jan Beulich <JBeulich@novell.com> | 2010-12-09 03:11:38 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-12-29 17:31:34 -0500 |
commit | 7ad1227818f09242cfe9bf1845fd24211f5f99bd (patch) | |
tree | c2de70d97c46adc192ec653983421c1812b5ddb3 /scripts/kconfig/menu.c | |
parent | 307991055b0ce65d53dc1eb501c456c10eb36360 (diff) |
kconfig: fix undesirable side effect of adding "visible" menu attribute
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>
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r-- | scripts/kconfig/menu.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index b9d9aa18e6d6..5f77dcb8977e 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -140,6 +140,20 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e | |||
140 | } | 140 | } |
141 | if (current_entry->prompt && current_entry != &rootmenu) | 141 | if (current_entry->prompt && current_entry != &rootmenu) |
142 | prop_warn(prop, "prompt redefined"); | 142 | prop_warn(prop, "prompt redefined"); |
143 | |||
144 | /* Apply all upper menus' visibilities to actual prompts. */ | ||
145 | if(type == P_PROMPT) { | ||
146 | struct menu *menu = current_entry; | ||
147 | |||
148 | while ((menu = menu->parent) != NULL) { | ||
149 | if (!menu->visibility) | ||
150 | continue; | ||
151 | prop->visible.expr | ||
152 | = expr_alloc_and(prop->visible.expr, | ||
153 | menu->visibility); | ||
154 | } | ||
155 | } | ||
156 | |||
143 | current_entry->prompt = prop; | 157 | current_entry->prompt = prop; |
144 | } | 158 | } |
145 | prop->text = prompt; | 159 | prop->text = prompt; |