mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 17:49:14 +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
|
while r>=l do begin
|
||||||
m:=(l+r) shr 1;
|
m:=(l+r) shr 1;
|
||||||
CurFilename:=@FListing.Names[FListing.NameStarts[m]];
|
CurFilename:=@FListing.Names[FListing.NameStarts[m]];
|
||||||
cmp:=ComparePCharFirstCaseInsThenCase(PChar(Pointer(UnitName)),CurFilename);
|
cmp:=stricomp(PChar(Pointer(UnitName)),CurFilename);
|
||||||
if cmp>0 then
|
if cmp>0 then
|
||||||
l:=m+1
|
l:=m+1
|
||||||
else if cmp<0 then
|
else if cmp<0 then
|
||||||
@ -683,9 +683,17 @@ begin
|
|||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
// now all files above m are higher than the Unitname
|
// 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
|
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 all files below m are lower than the Unitname
|
||||||
// -> now find a filename with correct case and extension
|
// -> now find a filename with correct case and extension
|
||||||
while m<FListing.NameCount do begin
|
while m<FListing.NameCount do begin
|
||||||
|
Loading…
Reference in New Issue
Block a user