codetools: fixed RunTool returning last line if it has no line break

git-svn-id: trunk@32590 -
This commit is contained in:
mattias 2011-10-01 18:03:51 +00:00
parent eb25db0014
commit 0da80378a2

View File

@ -1227,6 +1227,7 @@ begin
OutLen:=TheProcess.Output.Read(Buf[1],length(Buf));
end else
OutLen:=0;
//debugln(['RunTool OutLen=',OutLen,' Buf="',copy(Buf,1,OutLen),'"']);
LineStart:=1;
i:=1;
while i<=OutLen do begin
@ -1241,8 +1242,11 @@ begin
end;
inc(i);
end;
OutputLine:=copy(Buf,LineStart,OutLen-LineStart+1);
OutputLine:=OutputLine+copy(Buf,LineStart,OutLen-LineStart+1);
until OutLen=0;
//debugln(['RunTool Last=',OutputLine]);
if OutputLine<>'' then
Result.Add(OutputLine);
TheProcess.WaitOnExit;
finally
TheProcess.Free;