Skip to content

Commit

Permalink
Merge branch 'js/imap-send-curl-compilation-fix' into maint
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Nov 5, 2015
2 parents 3897d2d + 71d9257 commit c378862
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c378862

Please sign in to comment.