From 655557f2b33c870d6d2829db0f3a1ebc1ca1789b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Jul 2024 23:52:42 +0200 Subject: [PATCH] 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 --- src/tool_operate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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