Handle directory with CRLF.CRLF terminators

This commit is contained in:
James Mills 2016-09-22 23:51:34 +10:00
parent 65cbf62f8a
commit 4f2a87b748
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -368,9 +368,14 @@ func (i *Item) FetchDirectory() (Directory, error) {
var d Directory var d Directory
for _, line := range lines { for _, line := range lines {
if len(bytes.Trim(line, "\r\n")) == 0 {
continue
}
if len(line) == 1 && line[0] == END { if len(line) == 1 && line[0] == END {
break break
} }
var i Item var i Item
err := i.parse(line) err := i.parse(line)
if err != nil { if err != nil {