LCL: CreateRelativePath not relative for complete paths

git-svn-id: trunk@16593 -
This commit is contained in:
mattias 2008-09-15 12:35:27 +00:00
parent 61d23c0541
commit f74132f80f

View File

@ -1266,7 +1266,7 @@ begin
dec(BaseDirLen); dec(BaseDirLen);
if BaseDirLen=0 then exit; if BaseDirLen=0 then exit;
// skip matching directories // count shared directories
MinLen:=FileNameLength; MinLen:=FileNameLength;
if MinLen>BaseDirLen then MinLen:=BaseDirLen; if MinLen>BaseDirLen then MinLen:=BaseDirLen;
p:=1; p:=1;
@ -1281,6 +1281,7 @@ begin
and ((p>FileNameLength) or (CmpFilename[p]=PathDelim)) then and ((p>FileNameLength) or (CmpFilename[p]=PathDelim)) then
inc(DirCount); inc(DirCount);
if DirCount=0 then exit; if DirCount=0 then exit;
if FilenameIsAbsolute(BaseDirectory) and (DirCount=1) then exit;
// calculate needed up directories // calculate needed up directories
BaseDirLen:=length(BaseDirectory); BaseDirLen:=length(BaseDirectory);