From: Steve Holme Date: Sat, 22 Feb 2014 18:14:33 +0000 (+0000) Subject: tool: Fixed incorrect return code when setting HTTP request fails X-Git-Tag: curl-7_36_0~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee23d13a79;p=curl tool: Fixed incorrect return code when setting HTTP request fails During initialisation SetHTTPrequest() may fail and cURL would return PARAM_BAD_USE, which is equivalent to CURLE_NOT_BUILT_IN in cURL error terms. Instead, return CURLE_FAILED_INIT as we do for other functions that may fail during initialisation. --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 398cd812e..b77411bf1 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -314,13 +314,13 @@ static int operate_do(struct Configurable *config) if(SetHTTPrequest(config, (config->no_body?HTTPREQ_HEAD:HTTPREQ_GET), &config->httpreq)) { - res = PARAM_BAD_USE; + res = CURLE_FAILED_INIT; goto quit_curl; } } else { if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq)) { - res = PARAM_BAD_USE; + res = CURLE_FAILED_INIT; goto quit_curl; } }