mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 00:19:32 +02:00
codetools: fixed searching in directory cache
git-svn-id: trunk@12226 -
This commit is contained in:
parent
21ad18525e
commit
47f1526902
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user