kconfig: show '?' prompt even if no help text is available
[carl9170fw.git] / config / menu.c
index dcf22008b2d6e4732d1e2785b0706395a8e1b071..99222855544c3a7c2f67b3c33b3796eb36e5ff80 100644 (file)
@@ -332,8 +332,10 @@ void menu_finalize(struct menu *parent)
                         */
                        parentdep = expr_alloc_symbol(sym);
                } else if (parent->prompt)
+                       /* Menu node for 'menu' */
                        parentdep = parent->prompt->visible.expr;
                else
+                       /* Menu node for 'if' */
                        parentdep = parent->dep;
 
                /* For each child menu node... */
@@ -532,6 +534,35 @@ void menu_finalize(struct menu *parent)
                        *ep = expr_alloc_one(E_LIST, NULL);
                        (*ep)->right.sym = menu->sym;
                }
+
+               /*
+                * This code serves two purposes:
+                *
+                * (1) Flattening 'if' blocks, which do not specify a submenu
+                *     and only add dependencies.
+                *
+                *     (Automatic submenu creation might still create a submenu
+                *     from an 'if' before this code runs.)
+                *
+                * (2) "Undoing" any automatic submenus created earlier below
+                *     promptless symbols.
+                *
+                * Before:
+                *
+                *      A
+                *      if ... (or promptless symbol)
+                *       +-B
+                *       +-C
+                *      D
+                *
+                * After:
+                *
+                *      A
+                *      if ... (or promptless symbol)
+                *      B
+                *      C
+                *      D
+                */
                if (menu->list && (!menu->prompt || !menu->prompt->text)) {
                        for (last_menu = menu->list; ; last_menu = last_menu->next) {
                                last_menu->parent = parent;
@@ -797,14 +828,14 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym,
        get_symbol_props_str(r, sym, P_SELECT, _("  Selects: "));
        if (sym->rev_dep.expr) {
                str_append(r, _("  Selected by: "));
-               expr_gstr_print(sym->rev_dep.expr, r);
+               expr_gstr_print_revdep(sym->rev_dep.expr, r);
                str_append(r, "\n");
        }
 
        get_symbol_props_str(r, sym, P_IMPLY, _("  Implies: "));
        if (sym->implied.expr) {
                str_append(r, _("  Implied by: "));
-               expr_gstr_print(sym->implied.expr, r);
+               expr_gstr_print_revdep(sym->implied.expr, r);
                str_append(r, "\n");
        }