From: Junio C Hamano Date: Fri, 30 Oct 2015 20:06:58 +0000 (-0700) Subject: Merge branch 'js/imap-send-curl-compilation-fix' X-Git-Tag: v2.7.0-rc0~57 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e88e424f4c9d9c8b622cc6a2ebe6e1fa058676f5?ds=sidebyside;hp=-c Merge branch 'js/imap-send-curl-compilation-fix' "git imap-send" did not compile well with older version of cURL library. * js/imap-send-curl-compilation-fix: imap-send: only use CURLOPT_LOGIN_OPTIONS if it is actually available --- e88e424f4c9d9c8b622cc6a2ebe6e1fa058676f5 diff --combined imap-send.c index e9faaeaf2a,8c3fc212ba..4d3b7737a9 --- a/imap-send.c +++ b/imap-send.c @@@ -889,8 -889,9 +889,8 @@@ static char *cram(const char *challenge } /* response: " " */ - resp_len = strlen(user) + 1 + strlen(hex) + 1; - response = xmalloc(resp_len); - sprintf(response, "%s %s", user, hex); + response = xstrfmt("%s %s", user, hex); + resp_len = strlen(response) + 1; response_64 = xmalloc(ENCODED_SIZE(resp_len) + 1); encoded_len = EVP_EncodeBlock((unsigned char *)response_64, @@@ -1421,11 -1422,15 +1421,15 @@@ static CURL *setup_curl(struct imap_ser curl_easy_setopt(curl, CURLOPT_PORT, server.port); if (server.auth_method) { + #if LIBCURL_VERSION_NUM < 0x072200 + warning("No LOGIN_OPTIONS support in this cURL version"); + #else struct strbuf auth = STRBUF_INIT; strbuf_addstr(&auth, "AUTH="); strbuf_addstr(&auth, server.auth_method); curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf); strbuf_release(&auth); + #endif } if (!server.use_ssl)