فهرست منبع

* flush standard files only if they are opend for output, resolves #11170

git-svn-id: trunk@10866 -
florian 17 سال پیش
والد
کامیت
ff9273bf0d
1فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 8 4
      rtl/inc/system.inc

+ 8 - 4
rtl/inc/system.inc

@@ -825,10 +825,14 @@ Begin
    End;
 
   { Make sure that all output is written to the redirected file }
-  Flush(Output);
-  Flush(ErrOutput);
-  Flush(pstdout^);
-  Flush(StdErr);
+  if Textrec(Output).Mode=fmOutput then
+    Flush(Output);
+  if Textrec(ErrOutput).Mode=fmOutput then
+    Flush(ErrOutput);
+  if Textrec(pstdout^).Mode=fmOutput then
+    Flush(pstdout^);
+  if Textrec(StdErr).Mode=fmOutput then
+    Flush(StdErr);
 {$endif FPC_HAS_FEATURE_CONSOLEIO}
 
 {$if defined(MSWINDOWS) or defined(OS2)}