david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

- works with test ansi tty, but will need a rethink when we start

getting key_ codes instead
This commit is contained in:
Dan Lynch 2006-06-27 17:15:34 +00:00
parent f78fa3c59d
commit 11e280670d
1 changed files with 6 additions and 2 deletions

View File

@ -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--;
}