1
0
Fork 0

Fix comment detection.

This commit is contained in:
Captain ALM 2023-12-05 22:10:40 +00:00
parent 2d7f061aa1
commit ac71484962
Signed by untrusted user: alfred
GPG Key ID: 4E4ADD02609997B1
1 changed files with 1 additions and 1 deletions

View File

@ -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,