imap-send: only use CURLOPT_LOGIN_OPTIONS if it is actually available

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>

Johannes Schindelin committed Oct 26, 2015 at 14:14 UTC 71d92575251bdb8b5e1b5b3a5c649bb63d9fc116
1 file changed +4
imap-send.c
+4
@@ -1422,11 +1422,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
1422 curl_easy_setopt(curl, CURLOPT_PORT, server.port);
1423
1424 if (server.auth_method) {
1425 +#if LIBCURL_VERSION_NUM < 0x072200
1426 + warning("No LOGIN_OPTIONS support in this cURL version");
1427 +#else
1428 struct strbuf auth = STRBUF_INIT;
1429 strbuf_addstr(&auth, "AUTH=");
1430 strbuf_addstr(&auth, server.auth_method);
1431 curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
1432 strbuf_release(&auth);
1433 +#endif
1434 }
1435
1436 if (!server.use_ssl)