From: Daniel Stenberg Date: Thu, 8 Jan 2026 17:09:04 +0000 (+0100) Subject: tool_operate: remove 'else' for VMS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a25cf3d7cfdfc0b811738f50c9f0a5c446f1ac5;p=thirdparty%2Fcurl.git tool_operate: remove 'else' for VMS It seems malplaced as it then avoids the following logic when invoked from a VMS shell and that seems unlikely to be desired. Based on code review. I have no system to try this on. Follow-up to f1261bcdd7f Closes #20221 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 4bc98a1e52..81cfc5dd99 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -633,28 +633,27 @@ static CURLcode post_per_transfer(struct per_transfer *per, if(global->silent && !global->showerror) vms_show = VMSSTS_HIDE; } - else #endif - if(!config->synthetic_error && result && - (!global->silent || global->showerror)) { - const char *msg = per->errorbuffer; - curl_mfprintf(tool_stderr, "curl: (%d) %s\n", result, - msg[0] ? msg : curl_easy_strerror(result)); - if(result == CURLE_PEER_FAILED_VERIFICATION) - fputs(CURL_CA_CERT_ERRORMSG, tool_stderr); - } - else if(config->fail == FAIL_WITH_BODY) { - /* if HTTP response >= 400, return error */ - long code = 0; - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code); - if(code >= 400) { - if(!global->silent || global->showerror) - curl_mfprintf(tool_stderr, - "curl: (%d) The requested URL returned error: %ld\n", - CURLE_HTTP_RETURNED_ERROR, code); - result = CURLE_HTTP_RETURNED_ERROR; - } + if(!config->synthetic_error && result && + (!global->silent || global->showerror)) { + const char *msg = per->errorbuffer; + curl_mfprintf(tool_stderr, "curl: (%d) %s\n", result, + msg[0] ? msg : curl_easy_strerror(result)); + if(result == CURLE_PEER_FAILED_VERIFICATION) + fputs(CURL_CA_CERT_ERRORMSG, tool_stderr); + } + else if(config->fail == FAIL_WITH_BODY) { + /* if HTTP response >= 400, return error */ + long code = 0; + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code); + if(code >= 400) { + if(!global->silent || global->showerror) + curl_mfprintf(tool_stderr, + "curl: (%d) The requested URL returned error: %ld\n", + CURLE_HTTP_RETURNED_ERROR, code); + result = CURLE_HTTP_RETURNED_ERROR; } + } /* Set file extended attributes */ if(!result && config->xattr && outs->fopened && outs->stream) { rc = fwrite_xattr(curl, per->url, fileno(outs->stream));