mirror of https://gitlab.com/basile.b/dexed.git
parent
3ac5c18cc5
commit
ed737be415
|
|
@ -717,7 +717,30 @@ begin
|
||||||
if not (poUsePipes in aProcess.Options) then
|
if not (poUsePipes in aProcess.Options) then
|
||||||
exit;
|
exit;
|
||||||
//
|
//
|
||||||
aList.LoadFromStream(aProcess.Output);
|
sum := 0;
|
||||||
|
str := TMemoryStream.Create;
|
||||||
|
try
|
||||||
|
buffSz := aProcess.PipeBufferSize;
|
||||||
|
// temp fix: messages are cut if the TAsyncProcess version is used on simple TProcess.
|
||||||
|
if aProcess is TAsyncProcess then begin
|
||||||
|
while aProcess.Output.NumBytesAvailable <> 0 do begin
|
||||||
|
str.SetSize(sum + buffSz);
|
||||||
|
cnt := aProcess.Output.Read((str.Memory + sum)^, buffSz);
|
||||||
|
sum += cnt;
|
||||||
|
end;
|
||||||
|
end else begin
|
||||||
|
repeat
|
||||||
|
str.SetSize(sum + buffSz);
|
||||||
|
cnt := aProcess.Output.Read((str.Memory + sum)^, buffSz);
|
||||||
|
sum += cnt;
|
||||||
|
until
|
||||||
|
cnt = 0;
|
||||||
|
end;
|
||||||
|
str.Size := sum;
|
||||||
|
aList.LoadFromStream(str);
|
||||||
|
finally
|
||||||
|
str.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure processOutputToStream(aProcess: TProcess; output: TMemoryStream);
|
procedure processOutputToStream(aProcess: TProcess; output: TMemoryStream);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue