mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 17:59:08 +02:00
IDE: In compiler options -> Other -> Defines, catch an exception when parsing an invalid option.
git-svn-id: trunk@43727 -
This commit is contained in:
parent
0e189386d9
commit
9121265a10
@ -644,7 +644,7 @@ begin
|
||||
// ToDo: figure out the length in a more clever way.
|
||||
if (Length(aOptAndValue) < 3) or (aOptAndValue[1] <> '-') then
|
||||
raise Exception.CreateFmt('Invalid option or value "%s".', [aOptAndValue]);
|
||||
if aOptAndValue[2] in ['e', 'd', 'u', 'I', 'k', 'o'] then
|
||||
if aOptAndValue[2] in ['e', 'u', 'I', 'k', 'o'] then
|
||||
OptLen := 2
|
||||
else
|
||||
OptLen := 3;
|
||||
@ -1125,7 +1125,7 @@ begin
|
||||
for j := 0 to sl.Count-1 do
|
||||
if AnsiStartsStr('-d', sl[j]) then
|
||||
begin
|
||||
if not AnsiStartsStr(CommentId, sl[j]) then
|
||||
if (Length(sl[j]) > 2) and not AnsiStartsStr(CommentId, sl[j]) then
|
||||
fDefines.Add(sl[j])
|
||||
end
|
||||
else
|
||||
|
@ -145,6 +145,7 @@ var
|
||||
EditForm: TCustomDefinesForm;
|
||||
begin
|
||||
EditForm := TCustomDefinesForm.Create(Nil);
|
||||
try
|
||||
try
|
||||
EditForm.OptionsReader := FOptionsReader;
|
||||
EditForm.OptionsThread := FOptionsThread;
|
||||
@ -158,6 +159,10 @@ begin
|
||||
EditForm.ToCustomOptions(memoCustomOptions.Lines);
|
||||
memoCustomOptions.Invalidate;
|
||||
end;
|
||||
except
|
||||
on E: Exception do
|
||||
ShowMessage('Error parsing custom options: '+E.Message);
|
||||
end;
|
||||
finally
|
||||
EditForm.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user