]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: remove 'else' for VMS
authorDaniel Stenberg <daniel@haxx.se>
Thu, 8 Jan 2026 17:09:04 +0000 (18:09 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 8 Jan 2026 21:33:06 +0000 (22:33 +0100)
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

src/tool_operate.c

index 4bc98a1e52be30b07046c4c9a6d2fc9df491d7e3..81cfc5dd99e6b2ade587fa3f0299cc1d88e89e66 100644 (file)
@@ -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));