mirror of
https://github.com/ipxe/ipxe
synced 2026-05-23 20:00:12 +03:00
[console] Use symbolic character names in special character tests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -33,6 +33,7 @@ FILE_SECBOOT ( PERMITTED );
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <ipxe/ansiesc.h>
|
#include <ipxe/ansiesc.h>
|
||||||
|
#include <ipxe/keys.h>
|
||||||
#include <ipxe/lineconsole.h>
|
#include <ipxe/lineconsole.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,18 +50,18 @@ size_t line_putchar ( struct line_console *line, int character ) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Handle backspace characters */
|
/* Handle backspace characters */
|
||||||
if ( character == '\b' ) {
|
if ( character == BACKSPACE ) {
|
||||||
if ( line->index )
|
if ( line->index )
|
||||||
line->index--;
|
line->index--;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore carriage return */
|
/* Ignore carriage return */
|
||||||
if ( character == '\r' )
|
if ( character == CR )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Treat newline as a terminator */
|
/* Treat newline as a terminator */
|
||||||
if ( character == '\n' )
|
if ( character == LF )
|
||||||
character = 0;
|
character = 0;
|
||||||
|
|
||||||
/* Add character to buffer */
|
/* Add character to buffer */
|
||||||
|
|||||||
Reference in New Issue
Block a user