imap-send: only use CURLOPT_LOGIN_OPTIONS if it is actually available
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 26 Oct 2015 13:14:58 +0000 (14:14 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Oct 2015 20:10:30 +0000 (13:10 -0700)
This fixes the compilation on an older Linux that was used to debug
test failures when upgrading Git for Windows to Git v2.3.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c
index 37ac4aa86a740ecc8430afff3b9d3c7a0c753a34..8c3fc212bacb4da7c2afea4a2aa47e051a4ef1ca 100644 (file)
@@ -1422,11 +1422,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)