Pull request: all: get rid of labels
Merge in DNS/adguard-home from rm-labels to master Squashed commit of the following: commit 5e3688ed92b0f76a47078a55bc22c401422c914c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Dec 9 17:46:50 2021 +0300 all: imp code, docs commit 123d1ec52d0037315e8de94ab5a26b48cf0bf984 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Dec 9 17:14:05 2021 +0300 all: get rid of labels
This commit is contained in:
@@ -309,21 +309,22 @@ func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
loop:
|
||||
for _, f := range fields[1:] {
|
||||
switch hashIdx := strings.IndexByte(f, '#'); hashIdx {
|
||||
case 0:
|
||||
// The rest of the fields are a part of the comment so skip
|
||||
// immediately.
|
||||
break loop
|
||||
case -1:
|
||||
hosts = append(hosts, f)
|
||||
|
||||
continue
|
||||
case 0:
|
||||
// Go on.
|
||||
default:
|
||||
// Only a part of the field is a comment.
|
||||
hosts = append(hosts, f[:hashIdx])
|
||||
|
||||
break loop
|
||||
}
|
||||
|
||||
// The rest of the fields are a part of the comment so skip
|
||||
// immediately.
|
||||
break
|
||||
}
|
||||
|
||||
return ip, hosts
|
||||
|
||||
Reference in New Issue
Block a user