Skip to content

Commit

Permalink
net.ftp: fix dir() for file names, which contain spaces (fix #18800) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
itsokk committed Jul 7, 2023
1 parent ded6c38 commit 7d6e15f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vlib/net/ftp/ftp.v
Expand Up @@ -227,8 +227,14 @@ pub fn (mut zftp FTP) dir() ![]string {
mut dir := []string{}
sdir := list_dir.bytestr()
for lfile in sdir.split('\n') {
if lfile.len > 56 {
dir << lfile#[56..lfile.len - 1]
continue
}
if lfile.len > 1 {
dir << lfile.after(' ').trim_space()
trimmed := lfile.after(':')
dir << trimmed#[3..trimmed.len - 1]
continue
}
}
return dir
Expand Down

0 comments on commit 7d6e15f

Please sign in to comment.