mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-14 01:11:01 +00:00
words: fix parser to handle missing newline at end
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
c992504375
commit
954867fef5
@ -48,6 +48,8 @@ func parseWords(txt []byte) []string {
|
||||
i := bytes.IndexByte(txt, '\n')
|
||||
if i != -1 {
|
||||
word, txt = word[:i], txt[i+1:]
|
||||
} else {
|
||||
txt = nil
|
||||
}
|
||||
if word := strings.TrimSpace(string(word)); word != "" && word[0] != '#' {
|
||||
ret = append(ret, word)
|
||||
|
Loading…
x
Reference in New Issue
Block a user