packager: fix TLazPackage.IndexOfPkgFile (bug #0013100)

git-svn-id: trunk@18555 -
This commit is contained in:
paul 2009-02-04 09:01:13 +00:00
parent e5e0fb5feb
commit 1ed4d23890

View File

@ -3418,8 +3418,15 @@ end;
function TLazPackage.IndexOfPkgFile(PkgFile: TPkgFile): integer;
begin
Result:=FileCount-1;
while (Files[Result]<>PkgFile) do dec(Result);
Result := FileCount - 1;
if Result < 0 then
Exit;
while (Files[Result] <> PkgFile) do
begin
dec(Result);
if Result < 0 then
Exit;
end;
end;
function TLazPackage.SearchShortFilename(const ShortFilename: string;