geadline: use getchar
This commit is contained in:
parent
c4ce5b8566
commit
a432fd32c5
@ -12,7 +12,7 @@ geadline(prompt) {
|
||||
[buf] = 0;
|
||||
|
||||
loop {
|
||||
red &c;
|
||||
c = getchar();
|
||||
if ((c == 0xffff) | (c == 0x04)) {
|
||||
if ((size == 0) | (c == 0xffff)) {
|
||||
free(buf);
|
||||
@ -20,8 +20,8 @@ geadline(prompt) {
|
||||
}
|
||||
} else if (c == 0x1b) {
|
||||
// ESC code
|
||||
red &c; // skip [
|
||||
red &c; // value
|
||||
getchar(); // skip [
|
||||
c = getchar(); // value
|
||||
|
||||
if ((c == 'A') & (size > 0)) {
|
||||
loop {
|
||||
|
Loading…
Reference in New Issue
Block a user