diff mbox

fix undesirable side effect of adding "visible" menu attribute

Message ID 4D009D4A0200007800026DDB@vpn.id2.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich Dec. 9, 2010, 8:11 a.m. UTC
None
diff mbox

Patch

--- 2.6.37-rc5/scripts/kconfig/menu.c
+++ 2.6.37-rc5-kconfig-propagate-visibility/scripts/kconfig/menu.c
@@ -140,6 +140,20 @@  struct property *menu_add_prop(enum prop
 		}
 		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;