Skip to content

Commit

Permalink
Merge pull request #2 from gkze/master
Browse files Browse the repository at this point in the history
Handle empty comment lines
  • Loading branch information
guumaster authored Mar 15, 2020
2 parents bb30f39 + 6fb0630 commit 24a6c43
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file added hostctl
Binary file not shown.
2 changes: 1 addition & 1 deletion pkg/host/host_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func Read(r io.Reader, strict bool) (*hostFile, error) {
func IsHostLine(line string) bool {
p := strings.Split(cleanLine(line), " ")
i := 0
if p[0] == "#" {
if p[0] == "#" && len(p) > 1 {
i = 1
}
ip := net.ParseIP(p[i])
Expand Down

0 comments on commit 24a6c43

Please sign in to comment.