FTP: access files in root dir correctly

Accessing a file with an absolute path in the root dir but with no
directory specified was not handled correctly. This fix comes with four
new test cases that verify it.

Bug: http://curl.haxx.se/mail/lib-2013-04/0142.html
Reported by: Sam Deane
This commit is contained in:
Daniel Stenberg
2013-04-12 15:29:28 +02:00
parent c01735865f
commit 61d259f950
7 changed files with 221 additions and 4 deletions

57
tests/data/test1225 Normal file
View File

@@ -0,0 +1,57 @@
<testcase>
<info>
<keywords>
FTP
PASV
RETR
</keywords>
</info>
# Server-side
<reply>
<data>
data
to
see
that FTP
works
so does it?
</data>
</reply>
# Client-side
<client>
<server>
ftp
</server>
<name>
FTP fetch two files using absolute paths
</name>
<command>
ftp://%HOSTIP:%FTPPORT//foo/1225 ftp://%HOSTIP:%FTPPORT//foo/bar/1225
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
CWD /
CWD foo
EPSV
TYPE I
SIZE 1225
RETR 1225
CWD /
CWD /
CWD foo
CWD bar
EPSV
SIZE 1225
RETR 1225
QUIT
</protocol>
</verify>
</testcase>