Prevent DOS buffered input function from hanging in an infinite loop when redirected input reads a linefeed or reaches EOF.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3977
This commit is contained in:
parent
6f0506ec42
commit
f0cf2bc6b0
1 changed files with 4 additions and 0 deletions
|
@ -223,6 +223,10 @@ static Bitu DOS_21Handler(void) {
|
|||
free--;
|
||||
for(;;) {
|
||||
DOS_ReadFile(STDIN,&c,&n);
|
||||
if (n == 0) // End of file
|
||||
E_Exit("DOS:0x0a:Redirected input reached EOF");
|
||||
if (c == 10) // Line feed
|
||||
continue;
|
||||
if (c == 8) { // Backspace
|
||||
if (read) { //Something to backspace.
|
||||
// STDOUT treats backspace as non-destructive.
|
||||
|
|
Loading…
Add table
Reference in a new issue