diff options
author | Christopher Faylor <me@cgf.cx> | 2000-07-10 23:08:45 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-07-10 23:08:45 +0000 |
commit | 69859e869735335f19483c004e9b14106e94b825 (patch) | |
tree | 5e822eb9a9b449af2426158cef5dac1b7357318d /winsup/cygwin/fhandler_console.cc | |
parent | 79644761c787d976c58c6e010c9f81b2189fb279 (diff) | |
download | cygnal-69859e869735335f19483c004e9b14106e94b825.tar.gz cygnal-69859e869735335f19483c004e9b14106e94b825.tar.bz2 cygnal-69859e869735335f19483c004e9b14106e94b825.zip |
* fhandler_console.cc (fhandler_console::read): Unicode interface to
ReadConsoleInput only exists on W2K, so use workaround from Kazuhiro Fujieda
<fujieda@jaist.ac.jp>.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index ee95f855b..18809c922 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -161,7 +161,7 @@ fhandler_console::read (void *pv, size_t buflen) INPUT_RECORD input_rec; const char *toadd; - if (!ReadConsoleInputW (h, &input_rec, 1, &nread)) + if (!ReadConsoleInput (h, &input_rec, 1, &nread)) { syscall_printf ("ReadConsoleInput failed, %E"); __seterrno (); @@ -193,7 +193,11 @@ fhandler_console::read (void *pv, size_t buflen) } else { - nread = WideCharToMultiByte (CP_ACP, 0, &wch, 1, tmp + 1, sizeof (tmp) - 1, NULL, NULL); + tmp[1] = ich; + /* Need this check since US code page seems to have a bug when + converting a CTRL-U. */ + if ((unsigned char)ich > 0x7f) + OemToCharBuff (tmp + 1, tmp + 1, 1); if (!(input_rec.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED)) toadd = tmp + 1; else |