diff --git a/src/tool_operate.c b/src/tool_operate.c index 0aad54282..8eac65d6a 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1570,9 +1570,13 @@ static CURLcode operate_do(struct GlobalConfig *global, } } /* if CURLE_OK */ else if(result) { - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response); + long protocol; - if(response/100 == 4) + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response); + curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); + + if((protocol == CURLPROTO_FTP || protocol == CURLPROTO_FTPS) && + response / 100 == 4) /* * This is typically when the FTP server only allows a certain * amount of users and we are not one of them. All 4xx codes