From 5f98274e7f1f4a65b981ee11ca8b3c3456b64f67 Mon Sep 17 00:00:00 2001 From: vincents Date: Fri, 30 May 2008 22:04:59 +0000 Subject: [PATCH] IDE: pass IDEmake.cfg path as short file name, so quoting is needed (maybe fixes #11362) git-svn-id: trunk@15279 - --- ide/buildlazdialog.pas | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ide/buildlazdialog.pas b/ide/buildlazdialog.pas index 8e4ccec19b..802be955e1 100644 --- a/ide/buildlazdialog.pas +++ b/ide/buildlazdialog.pas @@ -545,10 +545,7 @@ begin if (blfUseMakeIDECfg in Flags) then begin MakeIDECfgFilename:=GetMakeIDEConfigFilename; if (FileExists(MakeIDECfgFilename)) then begin - if pos(' ', MakeIDECfgFilename)>0 then - ExtraOptions:='@"'+MakeIDECfgFilename+'"' - else - ExtraOptions:='@'+MakeIDECfgFilename; + ExtraOptions:='@'+MakeIDECfgFilename; exit; end; end; @@ -770,6 +767,18 @@ end; function GetMakeIDEConfigFilename: string; begin Result:=AppendPathDelim(GetPrimaryConfigPath)+DefaultIDEMakeOptionFilename; +{$ifdef windows} + // If a file name contains spaces, a file name whould need to be quoted. + // Using a single quote is not possible, it is used already in the + // makefile to group all options in OPT='bla bla'. + // using " implicates that make uses a shell to execute the command of that + // line. But shells (i.e. command.com, cmd.exe, etc) are so fragile + // that is better to avoid this. + // Therefore we use a short 8.3 file and path name, so we don't need to use + // quotes at all + if pos(' ',Result)>0 then + Result:=ExtractShortPathName(Result); +{$endif} end; { TConfigureBuildLazarusDlg }