← Commit list

6017e6ffed

Daniel Stenberg
Daniel Stenberg
2026-08-26
SUCCESS Duration: 427s

Subject

tool_paramhlp: --proto only supports one modifier

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

docs/cmdline-opts/proto.md+1 -1
@@ -18,7 +18,7 @@ Example:
Limit what protocols to allow for transfers. Protocols are evaluated left to
right, are comma separated, and are each a protocol name or 'all', optionally
-prefixed by zero or more modifiers. Available modifiers are:
+prefixed by a modifier. Available modifiers are:
## +
Permit this protocol in addition to protocols already permitted (this is
src/tool_paramhlp.c+2 -1
@@ -482,7 +482,8 @@ ParameterError proto2num(const char * const *val, char **ostr, const char *str)
if no protocols are allowed */
if(action == set)
protoset[0] = NULL;
- warnf("unrecognized protocol '%s'", buffer);
+ errorf("unrecognized protocol '%s'", buffer);
+ return PARAM_BAD_USE;
}
}
if(next)
tests/data/Makefile.am+1 -0
@@ -348,6 +348,7 @@ TESTCASES = \
test319 \
test320 \
test321 \
+ test322 \
test325 \
test326 \
test327 \
tests/data/test322+31 -0
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+--proto
+</keywords>
+</info>
+
+<client>
+<features>
+http
+</features>
+<name>
+--proto with multiple modifiers
+</name>
+<command>
+http://localhost/wont-get-this --proto +-http
+</command>
+</client>
+
+<verify>
+<errorcode>
+2
+</errorcode>
+<stderr mode="text">
+curl: unrecognized protocol '-http'
+curl: option --proto: is badly used here
+curl: try 'curl --help' or 'curl --manual' for more information
+</stderr>
+</verify>
+</testcase>