* fhandler_console.cc (fhandler_console::read): Unicode interface to

ReadConsoleInput only exists on W2K, so use workaround from Kazuhiro Fujieda
<fujieda@jaist.ac.jp>.
This commit is contained in:
Christopher Faylor 2000-07-10 23:08:45 +00:00
parent 79644761c7
commit 69859e8697
2 changed files with 12 additions and 2 deletions

View File

@ -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.

View File

@ -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