]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[mucurses] Attempt to fix keypress processing logic
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 12:42:02 +0000 (14:42 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 12:42:02 +0000 (14:42 +0200)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/hci/mucurses/kb.c

index 8face14d89593c873295dc11ccfe5dc579371d3b..a4b6ea871c0e81e792a67a9eeaa13586ed8185db 100644 (file)
@@ -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--;
-                       }
                }
        }