From: Patrick Monnerat Date: Fri, 23 Sep 2022 09:51:06 +0000 (+0200) Subject: tool: remove dead code X-Git-Tag: curl-7_86_0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce30d518de24504236e9d2137e00803fb22e31e5;p=thirdparty%2Fcurl.git tool: remove dead code Add a debug assertion to verify protocols included/excluded in a set are always tokenized. Follow-up to commit 677266c. Closes #9576 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 1d86927e15..5868188301 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1249,14 +1249,7 @@ static CURLcode single_transfer(struct GlobalConfig *global, if(result) break; - /* here */ use_proto = url_proto(per->this_url); -#if 0 - if(!use_proto) { - warnf(global, "URL is '%s' but no support for the scheme\n", - per->this_url); - } -#endif if(!config->tcp_nodelay) my_setopt(curl, CURLOPT_TCP_NODELAY, 0L); diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c index a8537eacd4..3a67e7ce13 100644 --- a/src/tool_paramhlp.c +++ b/src/tool_paramhlp.c @@ -271,6 +271,8 @@ static size_t protoset_index(const char * const *protoset, const char *proto) { const char * const *p = protoset; + DEBUGASSERT(proto == proto_token(proto)); /* Ensure it is tokenized. */ + for(; *p; p++) if(proto == *p) break;