Lazbuild: only match long options case insensitively, not short ones (because their set in lazbuild is case sensitive), issue #40217

This commit is contained in:
Maxim Ganetsky 2023-04-21 02:28:39 +03:00
parent 783c4ee8cb
commit a82f0d4e39

View File

@ -1322,19 +1322,10 @@ Var
Var Var
I : integer; I : integer;
begin begin
If CaseSensitiveOptions then S:=LowerCase(S);
begin I:=LongOpts.Count-1;
I:=LongOpts.Count-1; While (I>=0) and (LowerCase(LongOpts[i])<>S) do
While (I>=0) and (LongOpts[i]<>S) do Dec(i);
Dec(i);
end
else
begin
S:=UpperCase(S);
I:=LongOpts.Count-1;
While (I>=0) and (UpperCase(LongOpts[i])<>S) do
Dec(i);
end;
Result:=(I<>-1); Result:=(I<>-1);
end; end;
@ -1395,8 +1386,6 @@ begin
and (ToolParamStr(I+1)[i]<>OptionChar); and (ToolParamStr(I+1)[i]<>OptionChar);
If HaveArg then If HaveArg then
OV:=ToolParamStr(I+1); OV:=ToolParamStr(I+1);
If Not CaseSensitiveOptions then
O:=LowerCase(O);
L:=Length(O); L:=Length(O);
J:=2; J:=2;
NeedArg:=false; NeedArg:=false;
@ -1440,7 +1429,6 @@ end;
constructor TLazBuildApplication.Create(TheOwner: TComponent); constructor TLazBuildApplication.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
CaseSensitiveOptions:=False;
SetupDialogs; SetupDialogs;
Files:=TStringList.Create; Files:=TStringList.Create;
fMaxProcessCount:=-1; fMaxProcessCount:=-1;