diff options
-rw-r--r-- | win32/termios.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win32/termios.c b/win32/termios.c index 658af4a26..a1329ceba 100644 --- a/win32/termios.c +++ b/win32/termios.c | |||
@@ -25,11 +25,11 @@ int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout) | |||
25 | GetConsoleMode(cin, &mode); | 25 | GetConsoleMode(cin, &mode); |
26 | SetConsoleMode(cin, 0); | 26 | SetConsoleMode(cin, 0); |
27 | 27 | ||
28 | if (timeout > 0) { | ||
29 | if (WaitForSingleObject(cin, timeout) != WAIT_OBJECT_0) | ||
30 | goto done; | ||
31 | } | ||
32 | while (1) { | 28 | while (1) { |
29 | if (timeout > 0) { | ||
30 | if (WaitForSingleObject(cin, timeout) != WAIT_OBJECT_0) | ||
31 | goto done; | ||
32 | } | ||
33 | if (!ReadConsoleInput(cin, &record, 1, &nevent_out)) | 33 | if (!ReadConsoleInput(cin, &record, 1, &nevent_out)) |
34 | goto done; | 34 | goto done; |
35 | if (record.EventType != KEY_EVENT || !record.Event.KeyEvent.bKeyDown) | 35 | if (record.EventType != KEY_EVENT || !record.Event.KeyEvent.bKeyDown) |