From 31b9a322605127a6d7846f2c6b05f803ed20d738 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 22 Dec 2022 16:52:42 +0100 Subject: [PATCH] urldata: make 'ftp_create_missing_dirs' depend on FTP || SFTP Closes #10139 --- lib/setopt.c | 2 ++ lib/urldata.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/setopt.c b/lib/setopt.c index 46b8a99f33..691ce395a3 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1309,6 +1309,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) data->set.krb = (data->set.str[STRING_KRB_LEVEL]) ? TRUE : FALSE; break; #endif +#if !defined(CURL_DISABLE_FTP) || !defined(USE_SSH) case CURLOPT_FTP_CREATE_MISSING_DIRS: /* * An FTP/SFTP option that modifies an upload to create missing @@ -1322,6 +1323,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) else data->set.ftp_create_missing_dirs = (unsigned char)arg; break; +#endif case CURLOPT_READDATA: /* * FILE pointer to read the file to be uploaded from. Or possibly diff --git a/lib/urldata.h b/lib/urldata.h index 152226c4f0..67ce1b1c23 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1732,11 +1732,13 @@ struct UserDefined { unsigned char ftp_ccc; /* FTP CCC options: curl_ftpccc */ unsigned int accepttimeout; /* in milliseconds, 0 means no timeout */ #endif - /* Desppie the name ftp_create_missing_dirs is for FTP(S) and SFTP +#if !defined(CURL_DISABLE_FTP) || !defined(USE_SSH) + /* Despite the name, ftp_create_missing_dirs is for FTP(S) and SFTP 1 - create directories that don't exist 2 - the same but also allow MKD to fail once */ unsigned char ftp_create_missing_dirs; +#endif #ifdef USE_LIBSSH2 curl_sshhostkeycallback ssh_hostkeyfunc; /* hostkey check callback */ void *ssh_hostkeyfunc_userp; /* custom pointer to callback */