Skip to content

ftp: dir() fix in files which contain spaces - #18804

Merged
spytheman merged 3 commits into
vlang:masterfrom
itsokk:master
Jul 7, 2023
Merged

spytheman merged 3 commits into
vlang:masterfrom
itsokk:master

Conversation

@itsokk

@itsokk itsokk commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

Fixes #18800.

Comment thread vlib/net/ftp/ftp.v
spytheman added 2 commits July 7, 2023 06:29
…rrors

If for some reason trimmed has less than 4 elements, `trimmed[3..trimmed.len-1]` can cause a panic.
`trimmed#[3..trimmed.len-1]` will not, it will produce an empty [] in this case instead.
@spytheman

Copy link
Copy Markdown
Contributor

master, compared to the same program from the issue, but with the latest changes, from this PR:

#0 06:47:10 ᛋ master /v/vnew❱v run check_ftp.v 2> x
2
c.txt
file.txt
#0 06:47:40 ᛋ master /v/vnew❱git switch -
Switched to branch 'itsokk-master'
#0 06:47:43 ᛋ itsokk-master /v/vnew❱v run check_ftp.v 2> x
al 2
-rw-r-- 1 delian delian 0 Jul 07 2023 a b c.txt
-rw-r-- 1 delian delian 0 Jul 07 2023 text file.txt
#0 06:47:45 ᛋ itsokk-master /v/vnew❱

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find.
Thanks for the fix.

@spytheman
spytheman merged commit 7d6e15f into vlang:master Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FTP dir() wrong file names

3 participants