Browse Source

Call system.Flush only once within ReadFromStream nested in ExecuteFPC for interactve mode

git-svn-id: trunk@33033 -
pierre 9 years ago
parent
commit
987907d2a2
1 changed files with 6 additions and 10 deletions
  1. 6 10
      packages/fpmkunit/src/fpmkunit.pp

+ 6 - 10
packages/fpmkunit/src/fpmkunit.pp

@@ -1805,10 +1805,7 @@ var
         if ch in [#10, #13] then
         if ch in [#10, #13] then
         begin
         begin
           if Interactive then
           if Interactive then
-            begin
-              System.Writeln(output);
-              System.Flush(output);
-            end
+            System.Writeln(output)
           else if Verbose then
           else if Verbose then
             installer.log(vlInfo,sLine)
             installer.log(vlInfo,sLine)
           else
           else
@@ -1832,7 +1829,6 @@ var
                   if Interactive then
                   if Interactive then
                     begin
                     begin
                       System.Write(output,ch);
                       System.Write(output,ch);
-                      System.Flush(output);
                     end
                     end
                   else
                   else
                     sLine:=ch;
                     sLine:=ch;
@@ -1845,10 +1841,7 @@ var
         else
         else
         begin
         begin
           if Interactive then
           if Interactive then
-            begin
-              System.Write(output,ch);
-              System.Flush(output);
-            end
+            System.Write(output,ch)
           else
           else
             sLine := sLine + ch;
             sLine := sLine + ch;
         end;
         end;
@@ -1857,7 +1850,10 @@ var
 
 
       // keep partial lines, unlessin interactive mode
       // keep partial lines, unlessin interactive mode
       if not Interactive then
       if not Interactive then
-        ConsoleOutput.Position := BuffPos;
+        ConsoleOutput.Position := BuffPos
+        // Flush for interactive mode
+      else if n > 0 then
+        System.Flush(output);
     end;
     end;
 
 
     Result := n;
     Result := n;