Fix incorrect filename parsing
When the file creation year, file size and filename contains the same substring the parsed filename should contains only the correct filename
This commit is contained in:
3
ftp.go
3
ftp.go
@@ -4,6 +4,7 @@ package ftp
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/textproto"
|
||||
@@ -342,7 +343,7 @@ func parseLsListLineName(line string, fields []string, offset int) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
match := fields[offset-1]
|
||||
match := fmt.Sprintf(" %s ", fields[offset-1])
|
||||
index := strings.Index(line, match)
|
||||
if index == -1 {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user