FTP: skip CWD to entry dir when target is absolute

Closes #4332
This commit is contained in:
Zenju 2019-09-11 20:04:28 +02:00 committed by Daniel Stenberg
parent 1ca91bcdb5
commit acf1d2acd1
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 3 additions and 2 deletions

View File

@ -877,7 +877,9 @@ static CURLcode ftp_state_cwd(struct connectdata *conn)
if((conn->data->set.ftp_filemethod == FTPFILE_NOCWD) && !ftpc->cwdcount)
/* No CWD necessary */
result = ftp_state_mdtm(conn);
else if(conn->bits.reuse && ftpc->entrypath) {
else if(conn->bits.reuse && ftpc->entrypath &&
/* no need to go to entrypath when we have an absolute path */
!(ftpc->dirdepth && ftpc->dirs[0][0] == '/')) {
/* This is a re-used connection. Since we change directory to where the
transfer is taking place, we must first get back to the original dir
where we ended up after login: */

View File

@ -45,7 +45,6 @@ TYPE I
SIZE 1225
RETR 1225
CWD /
CWD /
CWD foo
CWD bar
EPSV