From 94db8e5c276f883ca035f28c52c4aeeb1cb18e1e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 30 Mar 2024 22:49:01 +0100 Subject: [PATCH] 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 --- src/tool_getparam.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.47.3