Merge branch 'js/imap-send-curl-compilation-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 30 Oct 2015 20:06:58 +0000 (13:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Oct 2015 20:06:58 +0000 (13:06 -0700)
"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

imap-send.c

index e9faaea..4d3b773 100644 (file)
@@ -1421,11 +1421,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
        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)