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
This commit is contained in:
Daniel Stenberg 2024-07-04 23:52:42 +02:00
parent bf88cdb790
commit 655557f2b3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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