ignore extra fields in a hosts file, since apparently some apps are putting comments on the same line (?).
This commit is contained in:
parent
b4220657be
commit
62bc0ad79a
|
@ -53,9 +53,10 @@ class HostKeyEntry:
|
|||
@type line: str
|
||||
"""
|
||||
fields = line.split(' ')
|
||||
if len(fields) != 3:
|
||||
if len(fields) < 3:
|
||||
# Bad number of fields
|
||||
return None
|
||||
fields = fields[:3]
|
||||
|
||||
names, keytype, key = fields
|
||||
names = names.split(',')
|
||||
|
|
Loading…
Reference in New Issue