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