diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-08-02 10:34:17 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-08-02 10:34:17 +0100 |
commit | 2e512282fd37f7dcb6d33e025e389f11d6d6d42f (patch) | |
tree | c83fde1b4d843b79d147db65ea538f5d86ebc429 | |
parent | 32ad2427ecda042a5eff93bae3773496ba5f44c1 (diff) | |
download | syslinux-2e512282fd37f7dcb6d33e025e389f11d6d6d42f.tar.gz syslinux-2e512282fd37f7dcb6d33e025e389f11d6d6d42f.tar.xz syslinux-2e512282fd37f7dcb6d33e025e389f11d6d6d42f.zip |
rawcon_read: Fix reading high part of input keys
commit 8486142cf304 ("elflink: Replace __intcall() with direct
function calls") made the mistake of zero'ing the high part of the
input key on every invocation of __rawcon_read() instead of preserving
it across calls like the old code, which lead to function keys such as
KEY_UP, KEY_DOWN, etc not working.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/lib/sys/rawcon_read.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/com32/lib/sys/rawcon_read.c b/com32/lib/sys/rawcon_read.c index 7eae95f1..51bb9536 100644 --- a/com32/lib/sys/rawcon_read.c +++ b/com32/lib/sys/rawcon_read.c @@ -44,15 +44,16 @@ ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count) { char *bufp = buf; size_t n = 0; - char hi = 0; + static char hi = 0; + static bool hi_key = false; (void)fp; while (n < count) { - if (hi) { + if (hi_key) { *bufp++ = hi; n++; - hi = 0; + hi_key = false; continue; } @@ -61,7 +62,11 @@ ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count) break; /* We have data, go get it */ - *bufp++ = getchar(&hi); + *bufp = getchar(&hi); + if (!*bufp) + hi_key = true; + + bufp++; n++; } |