[PATCH 1/3] menuconfig: factor out reserved letters

From: Ramkumar Ramachandra
Date: Wed Jul 10 2013 - 11:19:11 EST


These letters that should not be used in menu selection.

Cc: Michal Marek <mmarek@xxxxxxx>
Signed-off-by: Ramkumar Ramachandra <artagnon@xxxxxxxxx>
---
scripts/kconfig/lxdialog/menubox.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 38cd69c..5923f2c 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -57,6 +57,7 @@
*/

#include "dialog.h"
+#define RESERVED_LETTERS "YyNnMmHh"

static int menu_width, item_x;

@@ -71,7 +72,7 @@ static void do_print_item(WINDOW * win, const char *item, int line_y,

strncpy(menu_item, item, menu_width - item_x);
menu_item[menu_width - item_x] = '\0';
- j = first_alpha(menu_item, "YyNnMmHh");
+ j = first_alpha(menu_item, RESERVED_LETTERS);

/* Clear 'residue' of last item */
wattrset(win, dlg.menubox.atr);
@@ -290,14 +291,14 @@ do_resize:
else {
for (i = choice + 1; i < max_choice; i++) {
item_set(scroll + i);
- j = first_alpha(item_str(), "YyNnMmHh");
+ j = first_alpha(item_str(), RESERVED_LETTERS);
if (key == tolower(item_str()[j]))
break;
}
if (i == max_choice)
for (i = 0; i < max_choice; i++) {
item_set(scroll + i);
- j = first_alpha(item_str(), "YyNnMmHh");
+ j = first_alpha(item_str(), RESERVED_LETTERS);
if (key == tolower(item_str()[j]))
break;
}
--
1.8.3.2.736.g869de25

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/