From f7ad3ece4e06d52ddcc4d44f075cf200b466ee53 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Wed, 23 Nov 2011 12:18:58 +0000 Subject: [PATCH] Improve behavior when reaching the end of the buffer. (thanks ripsaw) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3761 --- src/dos/dos.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 150dde99..baba3c3b 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -220,6 +220,7 @@ static Bitu DOS_21Handler(void) { Bit8u free=mem_readb(data); Bit8u read=0;Bit8u c;Bit16u n=1; if (!free) break; + free--; for(;;) { DOS_ReadFile(STDIN,&c,&n); if (c == 8) { // Backspace @@ -232,7 +233,7 @@ static Bitu DOS_21Handler(void) { } continue; } - if (read >= free) { // Keyboard buffer full + if (read == free && c != 13) { // Keyboard buffer full Bit8u bell = 7; DOS_WriteFile(STDOUT, &bell, &n); continue;