summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2017-07-31 22:57:06 +0200
committerCorinna Vinschen <corinna@vinschen.de>2017-07-31 22:57:06 +0200
commite6c75c1de15f6be76987b63219ca4cca03761bec (patch)
tree44ea36dd7b5ae964f235c508a411c471cdccd7cc
parent7b9bfb4136f23655e243bab89fb62b04bdbacc7f (diff)
downloadcygnal-e6c75c1de15f6be76987b63219ca4cca03761bec.tar.gz
cygnal-e6c75c1de15f6be76987b63219ca4cca03761bec.tar.bz2
cygnal-e6c75c1de15f6be76987b63219ca4cca03761bec.zip
cygwin: select: use UNICODE console functions
For historical reasons peek_console was calling the functions PeekConsoleInputA and ReadConsoleInputA. However, these functions are not working correctly under at least codepage 65001 (UTF-8) on systems prior to Windows 10. Use PeekConsoleInputW and ReadConsoleInputW instead, which work correctly under all systems and all codepages. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/select.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 158de6af7..f5a993850 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -886,7 +886,7 @@ peek_console (select_record *me, bool)
for (;;)
if (fh->bg_check (SIGTTIN, true) <= bg_eof)
return me->read_ready = true;
- else if (!PeekConsoleInput (h, &irec, 1, &events_read) || !events_read)
+ else if (!PeekConsoleInputW (h, &irec, 1, &events_read) || !events_read)
break;
else
{
@@ -918,7 +918,7 @@ peek_console (select_record *me, bool)
}
/* Read and discard the event */
- ReadConsoleInput (h, &irec, 1, &events_read);
+ ReadConsoleInputW (h, &irec, 1, &events_read);
}
return me->write_ready;