From 4ea649b026493bc17c6f018fdf6d12ca5bb341ea Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 16 Sep 2010 06:55:26 +0000 Subject: [PATCH] IDE: fixed SearchDirectoryInSearchPath for trailing pathdelim git-svn-id: trunk@27380 - --- ide/ideprocs.pp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ide/ideprocs.pp b/ide/ideprocs.pp index 6fbe2ea57c..668cf00bf3 100644 --- a/ide/ideprocs.pp +++ b/ide/ideprocs.pp @@ -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