1
0
Fork 0

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:
ripsaw8080 2016-04-05 05:40:48 +00:00
parent 6f0506ec42
commit f0cf2bc6b0

View file

@ -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.