From 7b1283bbde8eaedc680506e4c95ea606dd9429ac Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 14 Sep 2022 20:50:00 +0300 Subject: [PATCH] change the #ifdef order in read_key(). --- src/commands.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commands.c b/src/commands.c index da72f8b..f29fe71 100644 --- a/src/commands.c +++ b/src/commands.c @@ -67,12 +67,7 @@ static int read_key(void) char key; int ret = 0; -#if defined(HAVE_TERMIOS_H) && !(defined(_WIN32) || defined(__DJGPP__) || defined(_DOS)) -#ifdef __CYGWIN__ - if (stdin_ready_for_reading()) -#endif - ret = read(0, &key, 1); -#elif defined(_WIN32) || defined(__OS2__) || defined(__DJGPP__) || defined(_DOS) +#if defined(_WIN32) || defined(__OS2__) || defined(__DJGPP__) || defined(_DOS) if (kbhit()) { key = getch(); ret = 1; @@ -86,6 +81,11 @@ static int read_key(void) ret = 1; } } +#elif defined(HAVE_TERMIOS_H)) +#ifdef __CYGWIN__ + if (stdin_ready_for_reading()) +#endif + ret = read(0, &key, 1); #else ret = 0; #endif