mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 17:01:38 +02:00
IDE: Try to switch path delimiters only for filenames when reading TCompilationToolOptions.Command. Issue #34476.
git-svn-id: trunk@59395 -
This commit is contained in:
parent
64a3cced51
commit
137181c237
@ -4274,10 +4274,27 @@ end;
|
|||||||
|
|
||||||
procedure TCompilationToolOptions.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
procedure TCompilationToolOptions.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
||||||
const Path: string; DoSwitchPathDelims: boolean);
|
const Path: string; DoSwitchPathDelims: boolean);
|
||||||
|
var
|
||||||
|
ParamList: TStringList;
|
||||||
|
Cmd, Param: String;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
//debugln(['TCompilationToolOptions.LoadFromXMLConfig ',Command,' Path=',Path,' DoSwitchPathDelims=',DoSwitchPathDelims]);
|
//debugln(['TCompilationToolOptions.LoadFromXMLConfig ',Command,' Path=',Path,' DoSwitchPathDelims=',DoSwitchPathDelims]);
|
||||||
Command:=SwitchPathDelims(XMLConfig.GetValue(Path+'Command/Value',''),
|
Cmd:=XMLConfig.GetValue(Path+'Command/Value','');
|
||||||
DoSwitchPathDelims);
|
ParamList:=TStringList.Create;
|
||||||
|
try
|
||||||
|
SplitCmdLineParams(Cmd, ParamList);
|
||||||
|
for i:=0 to ParamList.Count-1 do
|
||||||
|
begin // Try to switch path delimiters only for filenames.
|
||||||
|
Param:=ParamList[i]; // Example: "cmd /C \\server\path\executable.exe"
|
||||||
|
if (Length(Param)<>2) or (Param[1]<>'/') then
|
||||||
|
ParamList[i]:=SwitchPathDelims(Param,DoSwitchPathDelims);
|
||||||
|
end;
|
||||||
|
ParamList.Delimiter:=' ';
|
||||||
|
Command:=ParamList.DelimitedText;
|
||||||
|
finally
|
||||||
|
ParamList.Free;
|
||||||
|
end;
|
||||||
LoadStringList(XMLConfig,Parsers,Path+'Parsers/');
|
LoadStringList(XMLConfig,Parsers,Path+'Parsers/');
|
||||||
if Parsers.Count=0 then begin
|
if Parsers.Count=0 then begin
|
||||||
// read old format
|
// read old format
|
||||||
|
Loading…
Reference in New Issue
Block a user