mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 03:46:01 +02:00
ide+lazbuild: fixed expanding ~ on unix in lazarus.cfg, #40363
This commit is contained in:
parent
606ef3eac7
commit
cba7d8388f
@ -162,6 +162,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function GetParamsAndCfgFile: TStrings;
|
function GetParamsAndCfgFile: TStrings;
|
||||||
|
var
|
||||||
|
CfgDir: string;
|
||||||
|
|
||||||
procedure ExpandCfgFilename(var aParam: string);
|
procedure ExpandCfgFilename(var aParam: string);
|
||||||
// expand relative filenames in lazarus.cfg using the path of the cfg, not the currentdir
|
// expand relative filenames in lazarus.cfg using the path of the cfg, not the currentdir
|
||||||
@ -172,9 +174,7 @@ function GetParamsAndCfgFile: TStrings;
|
|||||||
for i:=low(LazFileOpts) to high(LazFileOpts) do
|
for i:=low(LazFileOpts) to high(LazFileOpts) do
|
||||||
if LazStartsText(LazFileOpts[i],aParam) then begin
|
if LazStartsText(LazFileOpts[i],aParam) then begin
|
||||||
aFilename:=copy(aParam,length(LazFileOpts[i])+1,length(aParam));
|
aFilename:=copy(aParam,length(LazFileOpts[i])+1,length(aParam));
|
||||||
aFilename:=ResolveDots(aFilename);
|
aFilename:=ExpandFileNameUTF8(aFilename,CfgDir);
|
||||||
if not FilenameIsAbsolute(aFilename) then
|
|
||||||
aFilename:=ResolveDots(ExtractFilePath(CfgFileName)+aFilename);
|
|
||||||
aParam:=LazFileOpts[i]+aFilename;
|
aParam:=LazFileOpts[i]+aFilename;
|
||||||
//debugln(['ExpandCfgFilename ',aParam]);
|
//debugln(['ExpandCfgFilename ',aParam]);
|
||||||
exit;
|
exit;
|
||||||
@ -220,6 +220,7 @@ begin
|
|||||||
if Cfg <> nil then begin
|
if Cfg <> nil then begin
|
||||||
Warn := '';
|
Warn := '';
|
||||||
// insert Cfg at start. For duplicates the latest occurrence takes precedence
|
// insert Cfg at start. For duplicates the latest occurrence takes precedence
|
||||||
|
CfgDir:=ExtractFilePath(CfgFileName);
|
||||||
for i := 0 to Cfg.Count - 1 do begin
|
for i := 0 to Cfg.Count - 1 do begin
|
||||||
s := Cfg[i];
|
s := Cfg[i];
|
||||||
if (s <> '') and (s[1] = '-') then
|
if (s <> '') and (s[1] = '-') then
|
||||||
|
Loading…
Reference in New Issue
Block a user