Fix comment detection.
This commit is contained in:
parent
2d7f061aa1
commit
ac71484962
@ -5,7 +5,7 @@ import "strings"
|
||||
func NewHostsEntry(lineIn string) Entry {
|
||||
trLineIn := strings.ReplaceAll(strings.Trim(lineIn, "\r\n"), " ", " ")
|
||||
lineSplt := strings.Split(trLineIn, " ")
|
||||
if len(lineSplt) == 1 && strings.HasPrefix(trLineIn, "#") {
|
||||
if len(lineSplt) == 1 && strings.HasPrefix(strings.TrimPrefix(" ", trLineIn), "#") {
|
||||
return Entry{
|
||||
IPAddress: "",
|
||||
Domains: nil,
|
||||
|
Loading…
Reference in New Issue
Block a user