mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 20:59:17 +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.
|
// ToDo: figure out the length in a more clever way.
|
||||||
if (Length(aOptAndValue) < 3) or (aOptAndValue[1] <> '-') then
|
if (Length(aOptAndValue) < 3) or (aOptAndValue[1] <> '-') then
|
||||||
raise Exception.CreateFmt('Invalid option or value "%s".', [aOptAndValue]);
|
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
|
OptLen := 2
|
||||||
else
|
else
|
||||||
OptLen := 3;
|
OptLen := 3;
|
||||||
@ -1125,7 +1125,7 @@ begin
|
|||||||
for j := 0 to sl.Count-1 do
|
for j := 0 to sl.Count-1 do
|
||||||
if AnsiStartsStr('-d', sl[j]) then
|
if AnsiStartsStr('-d', sl[j]) then
|
||||||
begin
|
begin
|
||||||
if not AnsiStartsStr(CommentId, sl[j]) then
|
if (Length(sl[j]) > 2) and not AnsiStartsStr(CommentId, sl[j]) then
|
||||||
fDefines.Add(sl[j])
|
fDefines.Add(sl[j])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -145,6 +145,7 @@ var
|
|||||||
EditForm: TCustomDefinesForm;
|
EditForm: TCustomDefinesForm;
|
||||||
begin
|
begin
|
||||||
EditForm := TCustomDefinesForm.Create(Nil);
|
EditForm := TCustomDefinesForm.Create(Nil);
|
||||||
|
try
|
||||||
try
|
try
|
||||||
EditForm.OptionsReader := FOptionsReader;
|
EditForm.OptionsReader := FOptionsReader;
|
||||||
EditForm.OptionsThread := FOptionsThread;
|
EditForm.OptionsThread := FOptionsThread;
|
||||||
@ -158,6 +159,10 @@ begin
|
|||||||
EditForm.ToCustomOptions(memoCustomOptions.Lines);
|
EditForm.ToCustomOptions(memoCustomOptions.Lines);
|
||||||
memoCustomOptions.Invalidate;
|
memoCustomOptions.Invalidate;
|
||||||
end;
|
end;
|
||||||
|
except
|
||||||
|
on E: Exception do
|
||||||
|
ShowMessage('Error parsing custom options: '+E.Message);
|
||||||
|
end;
|
||||||
finally
|
finally
|
||||||
EditForm.Free;
|
EditForm.Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user