avoid to parse invalid package list

This commit is contained in:
Basile Burg 2016-04-15 03:55:17 +02:00
parent 78544f3e3a
commit d88cc5c4f6
2 changed files with 12 additions and 4 deletions

View File

@ -178,12 +178,12 @@ inherited CELibManEditorWidget: TCELibManEditorWidget
item item
AutoSize = True AutoSize = True
Caption = 'Alias' Caption = 'Alias'
Width = 37 Width = 629
end end
item item
AutoSize = True AutoSize = True
Caption = 'Library file or folder of sources' Caption = 'Library file or folder of sources'
Width = 67 Width = 172
end end
item item
AutoSize = True AutoSize = True

View File

@ -250,8 +250,16 @@ var
cli: TFPHTTPClient; cli: TFPHTTPClient;
begin begin
cbb.Items.Clear; cbb.Items.Clear;
cli := TFPHTTPClient.Create(self); cli := TFPHTTPClient.Create(nil);
pge := cli.Get('https://code.dlang.org/'); try
try
pge := cli.Get('https://code.dlang.org/');
except
pge := '';
end;
finally
cli.Free;
end;
// note, also works with regex \"packages\/[a-zA-Z0-9_-]+\" // note, also works with regex \"packages\/[a-zA-Z0-9_-]+\"
with TStringRange.create(pge) do while not empty do with TStringRange.create(pge) do while not empty do
begin begin