From ca07b2048d6cf7fe11670aa7fcfca0d805d7f495 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 27 May 2017 20:04:48 +0100 Subject: [PATCH] Ignore comments in host files --- rpzhole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpzhole b/rpzhole index 56e5061..3dcc763 100755 --- a/rpzhole +++ b/rpzhole @@ -63,7 +63,7 @@ def parse_blacklist(format, filename=None, fobj=None): if format == 'hosts': for line in fobj: if line.strip() == '' or line[0] == '#': continue - hosts = [x for x in re.split ( r'\s+', line) if x != ''][1:] + hosts = [x for x in re.split ( r'\s+', line) if x != '' and x[0] != '#'][1:] data.extend(hosts) elif format == 'raw': for line in fobj: