]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
FAQ: Clarify Windows double quote usage
authorJay Satiro <raysatiro@yahoo.com>
Mon, 9 May 2022 06:22:39 +0000 (02:22 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 14 May 2022 06:38:58 +0000 (02:38 -0400)
- Windows command prompt doesn't use literal quoting via single quotes.

- Windows command prompt inner double quotes are escaped with a
  backslash.

- Windows powershell does use single quotes but curl is not a powershell
  script so the arguments may not be passed on correctly.

- Windows powershell inner double quotes seems can be passed to curl if
  the outer quotes are double quotes and an escape of backslash-backtick
  is used.

Command prompt example:

~~~
getargs -v -d "\"a\""

argv[0]: getargs
argv[1]: -v
argv[2]: -d
argv[3]: "a"
~~~

Ref: https://github.com/curl/curl/issues/8818
Ref: https://gist.github.com/jay/19aba48653bd591cf4b90eb9249a302c

Reported-by: KotlinIsland@users.noreply.github.com
Closes https://github.com/curl/curl/pull/8823

docs/FAQ

index b92f1bbb19164712d9d882d12bde0c2478569581..48cb903f3012acceac0df2cf570ad6882212fb55 100644 (file)
--- a/docs/FAQ
+++ b/docs/FAQ
@@ -588,7 +588,14 @@ FAQ
   Exactly what kind of quotes and how to do this is entirely up to the shell
   or command line interpreter that you are using. For most unix shells, you
   can more or less pick either single (') or double (") quotes. For
-  Windows/DOS prompts I believe you are forced to use double (") quotes.
+  Windows/DOS command prompts you must use double (") quotes, and if the
+  option string contains inner double quotes you can escape them with a
+  backslash.
+
+  For Windows powershell the arguments are not always passed on as expected
+  because curl is not a powershell script. You may or may not be able to use
+  single quotes. To escape inner double quotes seems to require a
+  backslash-backtick escape sequence and the outer quotes as double quotes.
 
   Please study the documentation for your particular environment. Examples in
   the curl docs will use a mix of both of these as shown above. You must