codetools: fixed CreateRelativePath

git-svn-id: trunk@28483 -
This commit is contained in:
mattias 2010-11-25 19:03:31 +00:00
parent 337ec99248
commit 0f237c154c
3 changed files with 7 additions and 6 deletions

View File

@ -420,12 +420,13 @@ function CompareCTCSVariables(const Left, Right: PCTCfgScriptVariable; out
Number:=Number div 10;
end;
end;
for i:=1 to Cnt do begin
for i:=0 to Cnt-1 do begin
if p^<>s[i] then begin
Equal:=false;
LeftIsLowerThanRight:=s[i]<p^;
exit;
end;
inc(p);
end;
if p^=#0 then begin
Equal:=true;
@ -444,6 +445,7 @@ begin
CheckCTCSVariable(Left);
CheckCTCSVariable(Right);
{$ENDIF}
//debugln(['CompareCTCSVariables AAA1 Left=',dbgs(Left),' Right=',dbgs(Right)]);
Result:=false;
Equal:=false;
LeftIsLowerThanRight:=false;

View File

@ -1435,19 +1435,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

View File

@ -4313,7 +4313,7 @@ begin
end;
AFilename:=TrimFilename(AFilename);
ProjectPath:=ProjectDirectory;
ProjectPath:=AppendPathDelim(ProjectDirectory);
if ProjectPath<>'' then begin
if Load then begin
// make filename absolute