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
1 changed files with 5 additions and 0 deletions

View File

@ -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 {