mirror of
https://github.com/limine-bootloader/limine
synced 2025-02-18 10:04:23 +03:00
getchar: Return \n when return is pressed instead of passing through \r from int 10h
This commit is contained in:
parent
b8e580b16c
commit
22ba144d98
BIN
limine-pxe.bin
BIN
limine-pxe.bin
Binary file not shown.
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
BIN
stage2.map
BIN
stage2.map
Binary file not shown.
@ -21,7 +21,12 @@ int getchar_internal(uint32_t eax) {
|
||||
case 0x53:
|
||||
return GETCHAR_DELETE;
|
||||
}
|
||||
return (char)(eax & 0xff);
|
||||
char c = eax & 0xff;
|
||||
switch (c) {
|
||||
case '\r':
|
||||
return '\n';
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
int getchar(void) {
|
||||
@ -106,7 +111,7 @@ void readline(const char *orig_str, char *buf, size_t limit) {
|
||||
buf[j] = 0;
|
||||
}
|
||||
continue;
|
||||
case '\r':
|
||||
case '\n':
|
||||
term_write("\n", 1);
|
||||
return;
|
||||
default:
|
||||
|
@ -138,7 +138,6 @@ refresh:
|
||||
|
||||
int c = getchar();
|
||||
switch (c) {
|
||||
case 0:
|
||||
case GETCHAR_CURSOR_DOWN:
|
||||
cursor_offset = get_next_line(cursor_offset, buffer);
|
||||
break;
|
||||
@ -177,9 +176,6 @@ refresh:
|
||||
*ret = true;
|
||||
disable_cursor();
|
||||
return (char *)orig_entry;
|
||||
case '\r':
|
||||
c = '\n';
|
||||
// FALLTHRU
|
||||
default:
|
||||
if (strlen(buffer) < EDITOR_MAX_BUFFER_SIZE - 1) {
|
||||
for (size_t i = strlen(buffer); ; i--) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user