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 | |
parent | 79644761c787d976c58c6e010c9f81b2189fb279 (diff) | |
download | newlib-69859e869735335f19483c004e9b14106e94b825.zip newlib-69859e869735335f19483c004e9b14106e94b825.tar.gz newlib-69859e869735335f19483c004e9b14106e94b825.tar.bz2 |
* 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')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fb86045..c509ceb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Mon Jul 10 19:07:03 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::read): Unicode interface + to ReadConsoleInput only exists on W2K, so use workaround from + Kazuhiro Fujieda <fujieda@jaist.ac.jp>. + Mon Jul 10 11:30:00 2000 Christopher Faylor <cgf@cygnus.com> * Makefile.in (install): Install textmode.o as well as binmode.o. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index ee95f85..18809c9 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 |