aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ftp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 7b942d823..cce1d9e9e 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2165,7 +2165,7 @@ CURLcode ftp_perform(struct connectdata *conn,
{
int i; /* counter for loop */
- for (i=0; ftp->dirs[i]; i++) {
+ for (i=0; i < ftp->dirdepth; i++) {
/* RFC 1738 says empty components should be respected too, but
that is plain stupid since CWD can't be used with an empty argument */
if ((result = ftp_cwd_and_mkd(conn, ftp->dirs[i])) != CURLE_OK)