mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:39:37 +02:00
IDE: fixed SearchDirectoryInSearchPath for trailing pathdelim
git-svn-id: trunk@27380 -
This commit is contained in:
parent
6f8a1be510
commit
4ea649b026
@ -726,6 +726,7 @@ var
|
||||
DirEndPos: Integer;
|
||||
CurDirLen: Integer;
|
||||
CurPath: string;
|
||||
CurPathLen: Integer;
|
||||
begin
|
||||
Result:=-1;
|
||||
DirLen:=length(Directory);
|
||||
@ -747,8 +748,13 @@ begin
|
||||
Result:=SearchPath.Count-1;
|
||||
while Result>=0 do begin
|
||||
CurPath:=SearchPath[Result];
|
||||
if (CurPath<>'')
|
||||
and (FileUtil.CompareFilenames(@CurPath[1],length(CurPath),
|
||||
CurPathLen:=length(CurPath);
|
||||
if CurPathLen>0 then
|
||||
begin
|
||||
while (CurPathLen>1) and (CurPath[CurPathLen]=PathDelim) do dec(CurPathLen);
|
||||
end;
|
||||
if (CurPathLen>0)
|
||||
and (FileUtil.CompareFilenames(@CurPath[1],CurPathLen,
|
||||
@Directory[DirStartPos],CurDirLen,
|
||||
false)=0)
|
||||
then begin
|
||||
|
Loading…
Reference in New Issue
Block a user