From: Michael Brown Date: Wed, 20 Dec 2006 22:12:53 +0000 (+0000) Subject: Use getkey() and symbolic key names. X-Git-Tag: v0.9.3~846 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5df1bc7df8a2a79bbb93dd3d6f38a93646469af;p=thirdparty%2Fipxe.git Use getkey() and symbolic key names. --- diff --git a/src/hci/readline.c b/src/hci/readline.c index 14dbeafef..4fac09867 100644 --- a/src/hci/readline.c +++ b/src/hci/readline.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -92,17 +93,17 @@ char * readline ( const char *prompt ) { buf[0] = '\0'; while ( 1 ) { - key = edit_string ( &string, getchar() ); + key = edit_string ( &string, getkey() ); sync_console ( &string ); switch ( key ) { - case 0x0d: /* Carriage return */ - case 0x0a: /* Line feed */ + case CR: + case LF: putchar ( '\n' ); line = strdup ( buf ); if ( ! line ) printf ( "Out of memory\n" ); return line; - case 0x03: /* Ctrl-C */ + case CTRL_C: putchar ( '\n' ); return NULL; default: