From e6d6601c176ffb2806e781eb4eceb82b085d5c60 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 22 Feb 2010 21:49:06 +0000 Subject: [PATCH] LCL: fixed CreateRelativePath e.g. ideintf/some.pas to ide git-svn-id: trunk@23760 - --- lcl/include/fileutil.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lcl/include/fileutil.inc b/lcl/include/fileutil.inc index 2af3ec738d..409edb2666 100644 --- a/lcl/include/fileutil.inc +++ b/lcl/include/fileutil.inc @@ -1325,19 +1325,18 @@ begin inc(BaseDirPos); end; end; + UpDirCount:=0; if ((BaseDirPos>BaseDirLen) or (CmpBaseDirectory[BaseDirPos]=PathDelim)) and ((p>FileNameLength) or (CmpFilename[p]=PathDelim)) then begin inc(DirCount); inc(BaseDirPos); - end; + end else + inc(UpDirCount); if DirCount=0 then exit; if FilenameIsAbsolute(BaseDirectory) and (DirCount=1) then exit; // calculate needed up directories - UpDirCount:=0; - if (BaseDirPos<=BaseDirLen) and (CmpBaseDirectory[BaseDirPos]<>PathDelim) then - inc(UpDirCount); while (BaseDirPos<=BaseDirLen) do begin if (CmpBaseDirectory[BaseDirPos]=PathDelim) then begin