summaryrefslogtreecommitdiffstats
path: root/src/hci/mucurses
diff options
context:
space:
mode:
authorDan Lynch2006-06-27 19:15:34 +0200
committerDan Lynch2006-06-27 19:15:34 +0200
commit11e280670dac60d322d33c132f92c885ab4e2331 (patch)
tree3cbb2e3c767c615b59c97d076feb43b0a6315af5 /src/hci/mucurses
parent- working basic ansi termnal extension for mucurses (diff)
downloadipxe-11e280670dac60d322d33c132f92c885ab4e2331.tar.gz
ipxe-11e280670dac60d322d33c132f92c885ab4e2331.tar.xz
ipxe-11e280670dac60d322d33c132f92c885ab4e2331.zip
- works with test ansi tty, but will need a rethink when we start
getting key_ codes instead
Diffstat (limited to 'src/hci/mucurses')
-rw-r--r--src/hci/mucurses/kb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/hci/mucurses/kb.c b/src/hci/mucurses/kb.c
index 5f113d9c..114e6b38 100644
--- a/src/hci/mucurses/kb.c
+++ b/src/hci/mucurses/kb.c
@@ -94,7 +94,8 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
_str = str;
- while ( ( ( c = wgetch( win ) ) != '\n' ) && !( n == 0 ) ) {
+ while (!( n == 0 ) ) {
+ c = wgetch( win );
if ( c >= 0401 && c <= 0633 ) {
switch(c) {
case KEY_LEFT :
@@ -107,7 +108,10 @@ int wgetnstr ( WINDOW *win, char *str, int n ) {
*_str = '\0';
break;
}
- } else { // *should* only be ASCII chars now
+ } else if ( c == '\n' ) {
+ *_str = '\0';
+ break;
+ }else { // *should* only be ASCII chars now
*(_str++) = (char)c;
n--;
}