tweaks: clean up after the previous change

master
Benno Schulenberg 2020-12-05 12:12:11 +01:00
parent 4f7593b704
commit 7ebf5f52b8
3 changed files with 14 additions and 18 deletions

View File

@ -68,15 +68,14 @@
#define PATH_MAX 4096 #define PATH_MAX 4096
#endif #endif
/* Ncurses support. */ /* Prefer wide ncurses over normal ncurses over curses. */
#if defined(HAVE_NCURSESW_NCURSES_H) #if defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h> #include <ncursesw/ncurses.h>
#elif defined(HAVE_NCURSES_H) #elif defined(HAVE_NCURSES_H)
#include <ncurses.h> #include <ncurses.h>
#else #else
/* Curses support. */
#include <curses.h> #include <curses.h>
#endif /* CURSES_H */ #endif
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
/* Native language support. */ /* Native language support. */

View File

@ -945,12 +945,11 @@ void do_suspend(int signal)
/* Put nano to sleep (if suspension is enabled). */ /* Put nano to sleep (if suspension is enabled). */
void do_suspend_void(void) void do_suspend_void(void)
{ {
if (ISSET(SUSPENDABLE)) { if (!ISSET(SUSPENDABLE)) {
do_suspend(0);
} else {
statusbar(_("Suspension is not enabled")); statusbar(_("Suspension is not enabled"));
beep(); beep();
} } else
do_suspend(0);
ran_a_tool = TRUE; ran_a_tool = TRUE;
} }
@ -1184,6 +1183,7 @@ void terminal_init(void)
raw(); raw();
nonl(); nonl();
noecho(); noecho();
disable_extended_io(); disable_extended_io();
if (ISSET(PRESERVE)) if (ISSET(PRESERVE))
@ -1767,12 +1767,10 @@ int main(int argc, char **argv)
fcntl(STDIN_FILENO, F_SETFL, stdin_flags & ~O_NONBLOCK); fcntl(STDIN_FILENO, F_SETFL, stdin_flags & ~O_NONBLOCK);
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
/* If setting the locale is successful and it uses UTF-8, we need /* If setting the locale is successful and it uses UTF-8, we will
* to use the multibyte functions for text processing. */ * need to use the multibyte functions for text processing. */
if (setlocale(LC_ALL, "") != NULL && if (setlocale(LC_ALL, "") && strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
strcmp(nl_langinfo(CODESET), "UTF-8") == 0) {
utf8_init(); utf8_init();
}
#else #else
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#endif #endif

View File

@ -178,9 +178,8 @@ void read_keys_from(WINDOW *win)
/* Before reading the first keycode, display any pending screen updates. */ /* Before reading the first keycode, display any pending screen updates. */
doupdate(); doupdate();
if (reveal_cursor) { if (reveal_cursor)
curs_set(1); curs_set(1);
}
/* Read in the first keycode, waiting for it to arrive. */ /* Read in the first keycode, waiting for it to arrive. */
while (input == ERR) { while (input == ERR) {