浏览代码

* Properly handle stdout for redir

Michaël Van Canneyt 1 年之前
父节点
当前提交
d45556666e
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      tests/utils/redir.pp

+ 4 - 1
tests/utils/redir.pp

@@ -810,7 +810,10 @@ begin
     P.CommandLine:=Progname + ' ' + ComLine;
     P.InputDescriptor.FileName:=RedirStdIn;
     P.OutputDescriptor.FileName:=RedirStdOut;
-    P.ErrorDescriptor.FileName:=RedirStdErr;
+    if RedirStdErr='stdout' then
+      P.Options:=P.options+[poStdErrToOutput]
+    else  
+      P.ErrorDescriptor.FileName:=RedirStdErr;
     P.Execute;
     Result:=P.WaitOnExit(max_count);
     if Result then