mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:29:34 +02:00
LazFileUtils: fix error in TryCreateRelativePath (it failed e.g with Dest=C:\ and Source=C:\foo), issue #27601
git-svn-id: branches/fixes_1_4@48129 -
This commit is contained in:
parent
103b55518d
commit
75846638ed
@ -323,7 +323,7 @@ begin
|
||||
end;
|
||||
|
||||
//debugln('TryCreaterelativePath: SharedFolders = ',DbgS(SharedFolders));
|
||||
if (SharedFolders = 0) and ((not IsAbs) or AlwaysRequireSharedBaseFolder) and not ((CmpDestLen = 0) and (CmpSourceLen = 0)) then
|
||||
if (SharedFolders = 0) and ((not IsAbs) or AlwaysRequireSharedBaseFolder) and not ((CmpDestLen = 0) or (CmpSourceLen = 0)) then
|
||||
begin
|
||||
//debguln('TryCreaterelativePath: FAIL: IsAbs = ',DbgS(IsAs),' AlwaysRequireSharedBaseFolder = ',DbgS(AlwaysRequireSharedBaseFolder),
|
||||
//' SharedFolders = 0, CmpDestLen = ',DbgS(cmpdestlen),' CmpSourceLen = ',DbgS(CmpSourceLen));
|
||||
|
@ -3098,11 +3098,14 @@ begin
|
||||
if NewTargetDirectory <> '' then
|
||||
switches := switches + ' '+PrepareCmdLineOption('-FE' + NewTargetDirectory);
|
||||
NewTargetFileName := ExtractFileName(NewTargetFilename);
|
||||
if (NewTargetFilename<>'')
|
||||
and (NewTargetFilename<>ChangeFileExt(ExtractFileName(CurMainSrcFile),GetTargetFileExt))
|
||||
then begin
|
||||
// custom target => pass -o
|
||||
switches := switches + ' '+PrepareCmdLineOption('-o' + NewTargetFileName);
|
||||
if (NewTargetFilename<>'') then
|
||||
begin
|
||||
if (not TargetFilenameApplyConventions)
|
||||
or (NewTargetFilename<>ChangeFileExt(ExtractFileName(CurMainSrcFile),GetTargetFileExt))
|
||||
then begin
|
||||
// custom target => pass -o
|
||||
switches := switches + ' '+PrepareCmdLineOption('-o' + NewTargetFileName);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user