Restore previous behavior for List

Fixes #251
This commit is contained in:
Julien Laffaye 2022-03-10 15:20:11 -05:00
parent 813c8a8384
commit d2c44e311e
2 changed files with 2 additions and 4 deletions

View File

@ -173,7 +173,7 @@ func (mock *ftpMock) listen() {
mock.dataConn.Wait()
mock.printfLine("150 Opening ASCII mode data connection for file list")
mock.dataConn.write([]byte("-rw-r--r-- 1 ftp wheel 0 Jan 29 10:29 lo"))
mock.dataConn.write([]byte("-rw-r--r-- 1 ftp wheel 0 Jan 29 10:29 lo\r\ntotal 1"))
mock.printfLine("226 Transfer complete")
mock.closeDataConn()
case "NLST":

4
ftp.go
View File

@ -640,9 +640,7 @@ func (c *ServerConn) List(path string) (entries []*Entry, err error) {
now := time.Now()
for scanner.Scan() {
entry, errParse := parser(scanner.Text(), now, c.options.location)
if errParse != nil {
errs = multierror.Append(errs, errParse)
} else {
if errParse == nil {
entries = append(entries, entry)
}
}