codetools: fixed searching in directory cache

git-svn-id: trunk@12226 -
This commit is contained in:
mattias 2007-09-28 23:11:44 +00:00
parent 21ad18525e
commit 47f1526902

View File

@ -674,7 +674,7 @@ begin
while r>=l do begin
m:=(l+r) shr 1;
CurFilename:=@FListing.Names[FListing.NameStarts[m]];
cmp:=ComparePCharFirstCaseInsThenCase(PChar(Pointer(UnitName)),CurFilename);
cmp:=stricomp(PChar(Pointer(UnitName)),CurFilename);
if cmp>0 then
l:=m+1
else if cmp<0 then
@ -683,9 +683,17 @@ begin
break;
end;
// now all files above m are higher than the Unitname
// -> check that m is equal or above
// -> check that m is equal or above = find lowest
if (Cmp>0) then
inc(m);
inc(m)
else if (Cmp=0) then begin
while (m>0) do begin
CurFilename:=@FListing.Names[FListing.NameStarts[m-1]];
cmp:=stricomp(PChar(Pointer(UnitName)),CurFilename);
if cmp<>0 then break;
end;
end;
// now all files below m are lower than the Unitname
// -> now find a filename with correct case and extension
while m<FListing.NameCount do begin