From 238e4fb9637f39e751527b69909f4ad81d8276b1 Mon Sep 17 00:00:00 2001 From: Juha Date: Sun, 2 Apr 2023 16:44:22 +0300 Subject: [PATCH] LazBuild: Support case-insensitive options, including contents of lazarus.cfg, like Lazarus does. Issue #40187. --- ide/lazbuild.lpr | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ide/lazbuild.lpr b/ide/lazbuild.lpr index 794f495f2a..54c9f01d60 100644 --- a/ide/lazbuild.lpr +++ b/ide/lazbuild.lpr @@ -194,17 +194,19 @@ procedure FilterConfigFileContent; var l: TStrings; i: Integer; + LowerOpt: String; begin ResetParamsAndCfg; l := GetCfgFileContent; if l = nil then exit; i := l.Count - 1; while i >= 0 do begin + LowerOpt := LowerCase(l[i]); if not( - (copy(l[i], 1, 22) = '--primary-config-path=') or - (copy(l[i], 1, 24) = '--secondary-config-path=') or - (copy(l[i], 1, 6) = '--pcp=') or - (copy(l[i], 1, 6) = '--scp=') + LazStartsStr('--primary-config-path=', LowerOpt) or + LazStartsStr('--secondary-config-path=', LowerOpt) or + LazStartsStr('--pcp=', LowerOpt) or + LazStartsStr('--scp=', LowerOpt) ) then l.Delete(i); @@ -1438,6 +1440,7 @@ end; constructor TLazBuildApplication.Create(TheOwner: TComponent); begin inherited Create(TheOwner); + CaseSensitiveOptions:=False; SetupDialogs; Files:=TStringList.Create; fMaxProcessCount:=-1;