mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 19:59:31 +02:00
codetools: fixed RunTool returning last line if it has no line break
git-svn-id: trunk@32590 -
This commit is contained in:
parent
eb25db0014
commit
0da80378a2
@ -1227,6 +1227,7 @@ begin
|
|||||||
OutLen:=TheProcess.Output.Read(Buf[1],length(Buf));
|
OutLen:=TheProcess.Output.Read(Buf[1],length(Buf));
|
||||||
end else
|
end else
|
||||||
OutLen:=0;
|
OutLen:=0;
|
||||||
|
//debugln(['RunTool OutLen=',OutLen,' Buf="',copy(Buf,1,OutLen),'"']);
|
||||||
LineStart:=1;
|
LineStart:=1;
|
||||||
i:=1;
|
i:=1;
|
||||||
while i<=OutLen do begin
|
while i<=OutLen do begin
|
||||||
@ -1241,8 +1242,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
OutputLine:=copy(Buf,LineStart,OutLen-LineStart+1);
|
OutputLine:=OutputLine+copy(Buf,LineStart,OutLen-LineStart+1);
|
||||||
until OutLen=0;
|
until OutLen=0;
|
||||||
|
//debugln(['RunTool Last=',OutputLine]);
|
||||||
|
if OutputLine<>'' then
|
||||||
|
Result.Add(OutputLine);
|
||||||
TheProcess.WaitOnExit;
|
TheProcess.WaitOnExit;
|
||||||
finally
|
finally
|
||||||
TheProcess.Free;
|
TheProcess.Free;
|
||||||
|
Loading…
Reference in New Issue
Block a user