mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Fix regression in kilo example
This commit is contained in:
parent
96bdd7e90f
commit
c4d8f40422
2 changed files with 6 additions and 2 deletions
|
@ -249,7 +249,10 @@ fatal:
|
|||
int editorReadKey(int64_t fd) {
|
||||
int nread;
|
||||
char c, seq[3];
|
||||
if ((nread = read(fd, &c, 1)) == -1) exit(1);
|
||||
do {
|
||||
nread = read(fd, &c, 1);
|
||||
if (nread == -1) exit(1);
|
||||
} while (!nread);
|
||||
|
||||
while (1) {
|
||||
switch (c) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue