aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-22 11:56:36 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-22 11:56:36 +1000
commit5a4583e25168f44b509713aee48cce031533d2fc (patch)
treed498e5d64399db1f656fcca4fc89980eac1fdde0 /win32
parent87994ae30fbb6056ba90e274445b3190feb84f76 (diff)
parent077d7bf83e6fdd85c7c348e2fcb3c51af9bc3934 (diff)
downloadbusybox-w32-5a4583e25168f44b509713aee48cce031533d2fc.tar.gz
busybox-w32-5a4583e25168f44b509713aee48cce031533d2fc.tar.bz2
busybox-w32-5a4583e25168f44b509713aee48cce031533d2fc.zip
Merge branch 'vi'
Diffstat (limited to 'win32')
-rw-r--r--win32/termios.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/win32/termios.c b/win32/termios.c
index 34a17bbfd..390b90382 100644
--- a/win32/termios.c
+++ b/win32/termios.c
@@ -10,7 +10,7 @@ int tcgetattr(int fd UNUSED_PARAM, struct termios *t UNUSED_PARAM)
10 return -1; 10 return -1;
11} 11}
12 12
13int64_t FAST_FUNC read_key(int fd, char *buf, int timeout UNUSED_PARAM) 13int64_t FAST_FUNC read_key(int fd, char *buf, int timeout)
14{ 14{
15 HANDLE cin = GetStdHandle(STD_INPUT_HANDLE); 15 HANDLE cin = GetStdHandle(STD_INPUT_HANDLE);
16 INPUT_RECORD record; 16 INPUT_RECORD record;
@@ -24,6 +24,10 @@ int64_t FAST_FUNC read_key(int fd, char *buf, int timeout UNUSED_PARAM)
24 GetConsoleMode(cin, &mode); 24 GetConsoleMode(cin, &mode);
25 SetConsoleMode(cin, 0); 25 SetConsoleMode(cin, 0);
26 26
27 if (timeout > 0) {
28 if (WaitForSingleObject(cin, timeout) != WAIT_OBJECT_0)
29 goto done;
30 }
27 while (1) { 31 while (1) {
28 if (!ReadConsoleInput(cin, &record, 1, &nevent_out)) 32 if (!ReadConsoleInput(cin, &record, 1, &nevent_out))
29 goto done; 33 goto done;