tweaks: clean up after the previous change

This commit is contained in:
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
#endif
/* Ncurses support. */
/* Prefer wide ncurses over normal ncurses over curses. */
#if defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h>
#elif defined(HAVE_NCURSES_H)
#include <ncurses.h>
#else
/* Curses support. */
#include <curses.h>
#endif /* CURSES_H */
#endif
#ifdef ENABLE_NLS
/* Native language support. */

View File

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

View File

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