From 4f2a87b74847a83e44bd7385a2381e49e397b202 Mon Sep 17 00:00:00 2001 From: James Mills Date: Thu, 22 Sep 2016 23:51:34 +1000 Subject: [PATCH] Handle directory with CRLF.CRLF terminators --- gopher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gopher.go b/gopher.go index 5dc0bfe..05b1e0c 100644 --- a/gopher.go +++ b/gopher.go @@ -368,9 +368,14 @@ func (i *Item) FetchDirectory() (Directory, error) { var d Directory for _, line := range lines { + if len(bytes.Trim(line, "\r\n")) == 0 { + continue + } + if len(line) == 1 && line[0] == END { break } + var i Item err := i.parse(line) if err != nil {