Fix some additional Windows TTY issues

This commit is contained in:
Justine Tunney 2023-10-03 23:53:59 -07:00
parent f26a280cda
commit 1694edf85c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
12 changed files with 107 additions and 43 deletions

View file

@ -115,7 +115,8 @@ static int ioctl_fionread(int fd, uint32_t *arg) {
}
} else if (GetConsoleMode(handle, &cm)) {
int bytes = CountConsoleInputBytes(g_fds.p + fd);
return MAX(0, bytes);
*arg = MAX(0, bytes);
return 0;
} else {
return eopnotsupp();
}