mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 23:18:01 +02:00
codetools: fixed CreateRelativePath
git-svn-id: trunk@28483 -
This commit is contained in:
parent
337ec99248
commit
0f237c154c
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user