Re: [PATCH 7/7] Do not use curl_easy_strerror with curl < 7.12.0
On Wed, Apr 5, 2017 at 3:04 PM, Tom G. Christensen <tgc@jupiterrise.com> wrote:
> Commit 17966c0a added an unguarded use of curl_easy_strerror.
> This adds a guard so it is not used with curl < 7.12.0.
Looks good to me. Eric Wong added this in 17966c0a63.
Show 25 quoted lines
> Signed-off-by: Tom G. Christensen <tgc@jupiterrise.com>
> ---
> http.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/http.c b/http.c
> index a46ab23af..104caaa75 100644
> --- a/http.c
> +++ b/http.c
> @@ -2116,8 +2116,12 @@ static size_t fwrite_sha1_file(char *ptr, size_t eltsize, size_t nmemb,
> CURLcode c = curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE,
> &slot->http_code);
> if (c != CURLE_OK)
> +#if LIBCURL_VERSION_NUM >= 0x070c00
> die("BUG: curl_easy_getinfo for HTTP code failed: %s",
> curl_easy_strerror(c));
> +#else
> + die("BUG: curl_easy_getinfo for HTTP code failed");
> +#endif
> if (slot->http_code >= 300)
> return size;
> }
> --
> 2.12.2
>