From: Daniel Stenberg Date: Sat, 30 Mar 2024 21:49:01 +0000 (+0100) Subject: tool_getparam: output warning for leading unicode quote character X-Git-Tag: curl-8_8_0~326 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94db8e5c276f883ca035f28c52c4aeeb1cb18e1e;p=thirdparty%2Fcurl.git tool_getparam: output warning for leading unicode quote character ... in the option argument. Typically this is a mistake done when copying example command lines from online documentation using the wrong quote character. Presumably there are also other potential quote characters that might be used, and this check is done without even knowing that unicode is used! Reported-by: Sanjay Pujare Fixes #13214 Closes #13215 --- diff --git a/src/tool_getparam.c b/src/tool_getparam.c index c6a9c93586..5cb898852b 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1337,6 +1337,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ warnf(global, "The file name argument '%s' looks like a flag.", nextarg); } + else if(!strncmp("\xe2\x80\x9c", nextarg, 3)) { + warnf(global, "The argument '%s' starts with a unicode quote where " + "maybe an ASCII \" was intended?", + nextarg); + } } else if((a->desc == ARG_NONE) && !toggle) { err = PARAM_NO_PREFIX;