IDE: fixed SearchDirectoryInSearchPath for trailing pathdelim

git-svn-id: trunk@27380 -
This commit is contained in:
mattias 2010-09-16 06:55:26 +00:00
parent 6f8a1be510
commit 4ea649b026

View File

@ -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