Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-11 03:08:45 +0400
committerChristopher Faylor <me@cgf.cx>2000-07-11 03:08:45 +0400
commit69859e869735335f19483c004e9b14106e94b825 (patch)
tree5e822eb9a9b449af2426158cef5dac1b7357318d /winsup/cygwin
parent79644761c787d976c58c6e010c9f81b2189fb279 (diff)
* 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/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler_console.cc8
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index fb8604513..c509ceb66 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 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