]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: simplify return code handling from url_proto()
authorDaniel Stenberg <daniel@haxx.se>
Thu, 4 Jul 2024 21:52:42 +0000 (23:52 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 5 Jul 2024 06:56:22 +0000 (08:56 +0200)
The additional checks were superfluous as it would only ever return
error if one of those protocols were set. Also: a returned error
*should* mean get out of there, without having to check more conditions.

Closes #14104

src/tool_operate.c

index 51c4041f2ed467fa17fe27f77daa57649dcab123..32d05198e1fcfaf6512aeb6317bad4ce58cea402 100644 (file)
@@ -1338,9 +1338,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
         if(result)
           break;
 
-        /* result is only used when for ipfs and ipns, ignored otherwise */
         result = url_proto(&per->this_url, config, &use_proto);
-        if(result && (use_proto == proto_ipfs || use_proto == proto_ipns))
+        if(result)
           break;
 
 #ifndef DEBUGBUILD