History

kconfig: menuconfig: remove OLD_NCURSES macro

This code has been here for more than 20 years. The bug in the old days no longer matters.

Masahiro Yamada committed 3 years ago

Commit 90fe4c51 parent 491b1463 files · +0 −33Browse files

Unified · Split

3 files
  1. scripts/kconfig/lxdialog/dialog.h +0 −16
  2. scripts/kconfig/lxdialog/menubox.c +0 −8
  3. scripts/kconfig/lxdialog/textbox.c +0 −9
scripts/kconfig/lxdialog/dialog.h+0−16
@@ -18,22 +18,6 @@ · 17 unmodified lines
1818 #endif
1919 #include <ncurses.h>
2020
21−/*
22− * Colors in ncurses 1.9.9e do not work properly since foreground and
23− * background colors are OR'd rather than separately masked. This version
24− * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible
25− * with standard curses. The simplest fix (to make this work with standard
26− * curses) uses the wbkgdset() function, not used in the original hack.
27− * Turn it off if we're building with 1.9.9e, since it just confuses things.
28− */
29−#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE)
30−#define OLD_NCURSES 1
31−#undef wbkgdset
32−#define wbkgdset(w,p) /*nothing */
33−#else
34−#define OLD_NCURSES 0
35−#endif
36−
3721 #define TR(params) _tracef params
3822
3923 #define KEY_ESC 27
scripts/kconfig/lxdialog/menubox.c+0−8
@@ -63,15 +63,7 @@ static void do_print_item(WINDOW * win, const char *item, int line_y, · 62 unmodified lines
6363 /* Clear 'residue' of last item */
6464 wattrset(win, dlg.menubox.atr);
6565 wmove(win, line_y, 0);
66−#if OLD_NCURSES
67− {
68− int i;
69− for (i = 0; i < menu_width; i++)
70− waddch(win, ' ');
71− }
72−#else
7366 wclrtoeol(win);
74−#endif
7567 wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr);
7668 mvwaddstr(win, line_y, item_x, menu_item);
7769 if (hotkey) {
scripts/kconfig/lxdialog/textbox.c+0−9
@@ -336,16 +336,7 @@ static void print_line(WINDOW * win, int row, int width) · 335 unmodified lines
336336 waddnstr(win, line, MIN(strlen(line), width - 2));
337337
338338 /* Clear 'residue' of previous line */
339−#if OLD_NCURSES
340− {
341− int x = getcurx(win);
342− int i;
343− for (i = 0; i < width - x; i++)
344− waddch(win, ' ');
345− }
346−#else
347339 wclrtoeol(win);
348−#endif
349340 }
350341
351342 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t