kconfig: menuconfig: remove OLD_NCURSES macro
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 25 Mar 2023 15:18:15 +0000 (00:18 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 17 Apr 2023 02:03:56 +0000 (11:03 +0900)
This code has been here for more than 20 years. The bug in the old days
no longer matters.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/lxdialog/dialog.h
scripts/kconfig/lxdialog/menubox.c
scripts/kconfig/lxdialog/textbox.c

index 68b565e..bd2da3a 100644 (file)
 #endif
 #include <ncurses.h>
 
-/*
- * Colors in ncurses 1.9.9e do not work properly since foreground and
- * background colors are OR'd rather than separately masked.  This version
- * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible
- * with standard curses.  The simplest fix (to make this work with standard
- * curses) uses the wbkgdset() function, not used in the original hack.
- * Turn it off if we're building with 1.9.9e, since it just confuses things.
- */
-#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE)
-#define OLD_NCURSES 1
-#undef  wbkgdset
-#define wbkgdset(w,p)          /*nothing */
-#else
-#define OLD_NCURSES 0
-#endif
-
 #define TR(params) _tracef params
 
 #define KEY_ESC 27
index 58c2f8a..0e33328 100644 (file)
@@ -63,15 +63,7 @@ static void do_print_item(WINDOW * win, const char *item, int line_y,
        /* Clear 'residue' of last item */
        wattrset(win, dlg.menubox.atr);
        wmove(win, line_y, 0);
-#if OLD_NCURSES
-       {
-               int i;
-               for (i = 0; i < menu_width; i++)
-                       waddch(win, ' ');
-       }
-#else
        wclrtoeol(win);
-#endif
        wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr);
        mvwaddstr(win, line_y, item_x, menu_item);
        if (hotkey) {
index 4e339b1..4a6ff9d 100644 (file)
@@ -336,16 +336,7 @@ static void print_line(WINDOW * win, int row, int width)
        waddnstr(win, line, MIN(strlen(line), width - 2));
 
        /* Clear 'residue' of previous line */
-#if OLD_NCURSES
-       {
-               int x = getcurx(win);
-               int i;
-               for (i = 0; i < width - x; i++)
-                       waddch(win, ' ');
-       }
-#else
        wclrtoeol(win);
-#endif
 }
 
 /*