summaryrefslogtreecommitdiffstats
path: root/src/hci
diff options
context:
space:
mode:
authorMichael Brown2017-03-21 13:42:02 +0100
committerMichael Brown2017-03-21 13:42:02 +0100
commit583d258b891902f85e623ca1d7b0ba7365673474 (patch)
tree21a638b6b0658f683f41b422bb596b9829a3c625 /src/hci
parent[mucurses] Attempt to fix test for empty string (diff)
downloadipxe-583d258b891902f85e623ca1d7b0ba7365673474.tar.gz
ipxe-583d258b891902f85e623ca1d7b0ba7365673474.tar.xz
ipxe-583d258b891902f85e623ca1d7b0ba7365673474.zip
[mucurses] Attempt to fix keypress processing logic
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci')
-rw-r--r--src/hci/mucurses/kb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hci/mucurses/kb.c b/src/hci/mucurses/kb.c
index 8face14d..a4b6ea87 100644
--- a/src/hci/mucurses/kb.c
+++ b/src/hci/mucurses/kb.c
@@ -103,7 +103,9 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
_wcursback( win );
wdelch( win );
} else {
- if ( c >= KEY_MIN ) {
+ if ( c >= 32 && c <= 126 ) {
+ *(_str++) = c; n--;
+ } else {
switch(c) {
case KEY_LEFT :
case KEY_BACKSPACE :
@@ -118,9 +120,6 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
break;
}
}
- if ( c >= 32 && c <= 126 ) {
- *(_str++) = c; n--;
- }
}
}