]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
docs: expand on quoting rules for file names in SFTP quote
authorDaniel Stenberg <daniel@haxx.se>
Sat, 11 Oct 2025 20:44:30 +0000 (22:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 12 Oct 2025 13:33:21 +0000 (15:33 +0200)
Reported-by: Harry Sintonen
Closes #19025

docs/cmdline-opts/quote.md
docs/libcurl/opts/CURLOPT_QUOTE.md

index 04a47424a0baadac089b7cccd6b0f393cbf42ba2..a5563010c6a5710982e29441e798bd8f59ef9d45 100644 (file)
@@ -37,9 +37,12 @@ You must send syntactically correct FTP commands as RFC 959 defines to FTP
 servers, or one of the commands listed below to SFTP servers.
 
 SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
-itself before sending them to the server. Filenames may be quoted shell-style
-to embed spaces or special characters. Following is the list of all supported
-SFTP quote commands:
+itself before sending them to the server. Filenames must be provided within
+double quotes to embed spaces, backslashes, quotes or double quotes. Within
+double quotes the following escape sequences are available for that purpose:
+\\, \", and \'.
+
+Following is the list of all supported SFTP quote commands:
 
 ## atime date file
 The atime command sets the last access time of the file named by the file
index 5e00f45137ef78c1550e5f174f8ac97370830b02..11b6997c6811c6c29ef91846b9a7f58b22518a81 100644 (file)
@@ -52,11 +52,15 @@ libcurl does not inspect, parse or "understand" the commands passed to the
 server using this option. If you change connection state, working directory or
 similar using quote commands, libcurl does not know about it.
 
-The path arguments for FTP or SFTP can use single or double quotes to
-distinguish a space from being the parameter separator or being a part of the
-path. e.g. rename with sftp using a quote command like this:
+The path arguments for FTP or SFTP should use double quotes to distinguish a
+space from being the parameter separator or being a part of the path. For
+example, rename with sftp using a quote command like this:
 
-    "rename 'test/_upload.txt' 'test/Hello World.txt'"
+    rename "test/_upload.txt" "test/Hello World.txt"
+
+For SFTP, filenames must be provided within double quotes to embed spaces,
+backslashes, quotes or double quotes. Within double quotes the following
+escape sequences are available for that purpose: \\, \", and \'.
 
 # SFTP commands