aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorZenju <zenju@gmx.de>2019-09-11 20:04:28 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-09-13 14:05:34 +0200
commitacf1d2acd17b194966be41e848ffd48b02ecef0c (patch)
tree03e6259c4328d9130246883409ca72557315d134 /lib/ftp.c
parent1ca91bcdb588dc6c25d345f2411fdba314433732 (diff)
FTP: skip CWD to entry dir when target is absolute
Closes #4332
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index e807a2acd..0793dc1f3 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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: */