From 987907d2a2b31ebcfb9334f022ba8b27d9052adb Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 29 Jan 2016 22:50:53 +0000 Subject: [PATCH] Call system.Flush only once within ReadFromStream nested in ExecuteFPC for interactve mode git-svn-id: trunk@33033 - --- packages/fpmkunit/src/fpmkunit.pp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/fpmkunit/src/fpmkunit.pp b/packages/fpmkunit/src/fpmkunit.pp index 3226a04ba9..1789996585 100644 --- a/packages/fpmkunit/src/fpmkunit.pp +++ b/packages/fpmkunit/src/fpmkunit.pp @@ -1805,10 +1805,7 @@ var if ch in [#10, #13] then begin if Interactive then - begin - System.Writeln(output); - System.Flush(output); - end + System.Writeln(output) else if Verbose then installer.log(vlInfo,sLine) else @@ -1832,7 +1829,6 @@ var if Interactive then begin System.Write(output,ch); - System.Flush(output); end else sLine:=ch; @@ -1845,10 +1841,7 @@ var else begin if Interactive then - begin - System.Write(output,ch); - System.Flush(output); - end + System.Write(output,ch) else sLine := sLine + ch; end; @@ -1857,7 +1850,10 @@ var // keep partial lines, unlessin interactive mode if not Interactive then - ConsoleOutput.Position := BuffPos; + ConsoleOutput.Position := BuffPos + // Flush for interactive mode + else if n > 0 then + System.Flush(output); end; Result := n;