From: Daniel Stenberg Date: Thu, 4 Jul 2024 21:52:42 +0000 (+0200) Subject: tool_operate: simplify return code handling from url_proto() X-Git-Tag: curl-8_9_0~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=655557f2b33c870d6d2829db0f3a1ebc1ca1789b;p=thirdparty%2Fcurl.git tool_operate: simplify return code handling from url_proto() 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 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 51c4041f2e..32d05198e1 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -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