[7/7] kconfig: truncate too long menu lines in menuconfig

From: Sam Ravnborg
Date: Mon Nov 21 2005 - 17:41:40 EST


kconfig: truncate too long menu lines in menuconfig

menu lines wrapped over too lines when too long - truncate them.
Also fixed a coding style issue

Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>

diff --git a/scripts/lxdialog/menubox.c b/scripts/lxdialog/menubox.c
index d0bf32b..2d91880 100644
--- a/scripts/lxdialog/menubox.c
+++ b/scripts/lxdialog/menubox.c
@@ -68,11 +68,11 @@ static void do_print_item(WINDOW * win,
int selected, int hotkey)
{
int j;
char *menu_item = malloc(menu_width + 1);

- strncpy(menu_item, item, menu_width);
+ strncpy(menu_item, item, menu_width - ITEM_IDENT);
menu_item[menu_width] = 0;
j = first_alpha(menu_item, "YyNnMmHh");

/* Clear 'residue' of last item */
wattrset(win, menubox_attr);
@@ -182,12 +182,12 @@ static void do_scroll(WINDOW *win, int *
int dialog_menu(const char *title, const char *prompt, int height, int width,
int menu_height, const char *current, int item_no,
const char *const *items)
{
int i, j, x, y, box_x, box_y;
- int key = 0, button = 0, scroll = 0, choice = 0, first_item =
- 0, max_choice;
+ int key = 0, button = 0, scroll = 0, choice = 0;
+ int first_item = 0, max_choice;
WINDOW *dialog, *menu;
FILE *f;

max_choice = MIN(menu_height, item_no);

-
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/