From: Steven Black Date: Sun, 9 Jul 2017 17:13:57 +0000 (-0400) Subject: Merge pull request #341 from indrajitr/hostmatch-fix X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d945d7bcc0a972ead595e8286bee0639cdf4d327;p=stevenblack-hosts.git Merge pull request #341 from indrajitr/hostmatch-fix Honor whitelist exclusion only for domain or subdomain match --- d945d7bcc0a972ead595e8286bee0639cdf4d327 diff --cc updateHostsFile.py index 289191ee1,27d5b0962..4d795e7ec --- a/updateHostsFile.py +++ b/updateHostsFile.py @@@ -480,12 -469,9 +480,12 @@@ def remove_dups_and_excl(merge_file) continue # Normalize rule - hostname, normalized_rule = normalize_rule(stripped_rule) + hostname, normalized_rule = normalize_rule( + stripped_rule, target_ip=settings["targetip"], + keep_domain_comments=settings["keepdomaincomments"]) + for exclude in exclusions: - if exclude in line: + if re.search('[\s\.]' + re.escape(exclude) + '\s', line): write_line = False break