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

Showing the changes to scripts (3 of 3 files). Show all

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
18#endif18#endif
19#include <ncurses.h>19#include <ncurses.h>
20 20
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
37#define TR(params) _tracef params21#define TR(params) _tracef params
38 22
39#define KEY_ESC 2723#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
63 /* Clear 'residue' of last item */63 /* Clear 'residue' of last item */
64 wattrset(win, dlg.menubox.atr);64 wattrset(win, dlg.menubox.atr);
65 wmove(win, line_y, 0);65 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
73 wclrtoeol(win);66 wclrtoeol(win);
74#endif
75 wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr);67 wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr);
76 mvwaddstr(win, line_y, item_x, menu_item);68 mvwaddstr(win, line_y, item_x, menu_item);
77 if (hotkey) {69 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
336 waddnstr(win, line, MIN(strlen(line), width - 2));336 waddnstr(win, line, MIN(strlen(line), width - 2));
337 337
338 /* Clear 'residue' of previous line */338 /* 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
347 wclrtoeol(win);339 wclrtoeol(win);
348#endif
349}340}
350 341
351/*342/*

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