From b23456007547b6449ca2a5b09c827096cfcbcdbd Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sat, 7 Aug 2010 18:49:53 +0000 Subject: [PATCH] Only flush buffer if we are reading from the console. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3635 --- src/dos/dos.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 35eb73e9..a3ec0a70 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -227,10 +227,13 @@ static Bitu DOS_21Handler(void) { break; case 0x0c: /* Flush Buffer and read STDIN call */ { - /* flush STDIN-buffer */ - Bit8u c;Bit16u n; - while (DOS_GetSTDINStatus()) { - n=1; DOS_ReadFile(STDIN,&c,&n); + /* flush buffer if STDIN is CON */ + Bit8u handle=RealHandle(STDIN); + if (handle!=0xFF && Files[handle] && Files[handle]->IsName("CON")) { + Bit8u c;Bit16u n; + while (DOS_GetSTDINStatus()) { + n=1; DOS_ReadFile(STDIN,&c,&n); + } } switch (reg_al) { case 0x1: