kconfig: nconf: remove unneeded default for menu prompt
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 10 Apr 2021 19:45:33 +0000 (04:45 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 14 Apr 2021 06:22:49 +0000 (15:22 +0900)
The rootmenu always has a prompt even if the 'mainmenu' statement is
missing in the top Kconfig file.

conf_parse() calls menu_add_prompt(P_MENU, "Main menu", NULL) in this
case.

So, every 'menu' has a prompt.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/nconf.c

index bcfcf0b..8187a2e 100644 (file)
@@ -1066,7 +1066,6 @@ static int do_match(int key, struct match_state *state, int *ans)
 static void conf(struct menu *menu)
 {
        struct menu *submenu = NULL;
-       const char *prompt = menu_get_prompt(menu);
        struct symbol *sym;
        int res;
        int current_index = 0;
@@ -1084,9 +1083,8 @@ static void conf(struct menu *menu)
                if (!child_count)
                        break;
 
-               show_menu(prompt ? prompt : "Main Menu",
-                               menu_instructions,
-                               current_index, &last_top_row);
+               show_menu(menu_get_prompt(menu), menu_instructions,
+                         current_index, &last_top_row);
                keypad((menu_win(curses_menu)), TRUE);
                while (!global_exit) {
                        if (match_state.in_search) {