mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-09-24 22:05:14 +01:00
Issue #77: fix - Remove spurrious spaces.
This commit is contained in:
+1
-1
@@ -282,7 +282,7 @@ def normalizeRule(rule):
|
||||
result = re.search(r'^[ \t]*(\d+\.\d+\.\d+\.\d+)\s+([\w\.-]+)(.*)', rule)
|
||||
if result:
|
||||
hostname, suffix = result.group(2,3)
|
||||
hostname = hostname.lower() # explicitly lowercase hostname
|
||||
hostname = hostname.lower().strip() # explicitly lowercase and trim the hostname
|
||||
if suffix is not '':
|
||||
# add suffix as comment only, not as a separate host
|
||||
return hostname, "%s %s #%s\n" % (TARGET_HOST, hostname, suffix)
|
||||
|
||||
Reference in New Issue
Block a user