From ccd3fed5b2bddf20be5fcd2d4bffd79df08db411 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 3 Feb 2004 18:48:12 -0800 Subject: [PATCH] fix menuconfig choice item help display From: Bjorn Helgaas Anders Gustafsson Roman Zippel This patch fixes menuconfig so it can display help text for individual choice group config entries. Previously it would only display the help text attached to the "choice" item. There was no way to display the help attached to individual config entries inside the choice group. Typically, the "choice" item has no help text, and all the useful help is attached to the individual entries, so this was a bit of a problem. --- scripts/kconfig/mconf.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 1a8e7c414445..b3c24cb98bfe 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -607,6 +607,7 @@ static void conf_choice(struct menu *menu) struct symbol *active; int stat; + active = sym_get_choice_value(menu->sym); while (1) { cprint_init(); cprint("--title"); @@ -618,24 +619,32 @@ static void conf_choice(struct menu *menu) cprint("6"); current_menu = menu; - active = sym_get_choice_value(menu->sym); for (child = menu->list; child; child = child->next) { if (!menu_is_visible(child)) continue; cprint("%p", child); cprint("%s", menu_get_prompt(child)); - cprint(child->sym == active ? "ON" : "OFF"); + if (child->sym == sym_get_choice_value(menu->sym)) + cprint("ON"); + else if (child->sym == active) + cprint("SELECTED"); + else + cprint("OFF"); } stat = exec_conf(); switch (stat) { case 0: - if (sscanf(input_buf, "%p", &menu) != 1) + if (sscanf(input_buf, "%p", &child) != 1) break; - sym_set_tristate_value(menu->sym, yes); + sym_set_tristate_value(child->sym, yes); return; case 1: - show_help(menu); + if (sscanf(input_buf, "%p", &child) == 1) { + show_help(child); + active = child->sym; + } else + show_help(menu); break; case 255: return; -- cgit v1.2.3