diff options
author | Ron Yorston <rmy@pobox.com> | 2014-03-24 19:16:49 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-03-24 19:21:08 +0000 |
commit | 20183fb965560d7d299d5f746bdeb5e2700f7e01 (patch) | |
tree | 31522bcbeec3b0c4e641384000f1fcd144c4ba47 | |
parent | a89d412ced2d9498260dae34fa8aa9e28fa56ca8 (diff) | |
download | busybox-w32-20183fb965560d7d299d5f746bdeb5e2700f7e01.tar.gz busybox-w32-20183fb965560d7d299d5f746bdeb5e2700f7e01.tar.bz2 busybox-w32-20183fb965560d7d299d5f746bdeb5e2700f7e01.zip |
Only change codepage of input character if top bit is set
It seems that passing control characters through OemToCharBuff is
not a good idea: some of them end up in the top half of the
codepage.
-rw-r--r-- | win32/termios.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/termios.c b/win32/termios.c index 40e70309e..2b1d2c761 100644 --- a/win32/termios.c +++ b/win32/termios.c | |||
@@ -75,8 +75,10 @@ int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout) | |||
75 | } | 75 | } |
76 | continue; | 76 | continue; |
77 | } | 77 | } |
78 | s = &record.Event.KeyEvent.uChar.AsciiChar; | 78 | if ( (record.Event.KeyEvent.uChar.AsciiChar & 0x80) == 0x80 ) { |
79 | OemToCharBuff(s, s, 1); | 79 | s = &record.Event.KeyEvent.uChar.AsciiChar; |
80 | OemToCharBuff(s, s, 1); | ||
81 | } | ||
80 | ret = record.Event.KeyEvent.uChar.AsciiChar; | 82 | ret = record.Event.KeyEvent.uChar.AsciiChar; |
81 | break; | 83 | break; |
82 | } | 84 | } |