diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2008-02-13 17:28:00 +0000 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2008-02-13 17:28:00 +0000 |
commit | 1860f08d41492b7ce4fcf3cc61aaa263193f06cd (patch) | |
tree | 244b253414e037b63a4fdddf100d66faeb55a548 /lisp/net/ange-ftp.el | |
parent | 02dfeba8a4ce93dadd7f5fa7f462fca12fdf28f8 (diff) | |
download | emacs-1860f08d41492b7ce4fcf3cc61aaa263193f06cd.tar.gz emacs-1860f08d41492b7ce4fcf3cc61aaa263193f06cd.tar.bz2 emacs-1860f08d41492b7ce4fcf3cc61aaa263193f06cd.zip |
* net/ange-ftp.el (ange-ftp-quote-string): Use
`shell-quote-argument'. This DTRT even on w32 machines.
(ange-ftp-cf1): Quote FILENAME.
Diffstat (limited to 'lisp/net/ange-ftp.el')
-rw-r--r-- | lisp/net/ange-ftp.el | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index da62fc8bc74..aeb2a8dc0d5 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1523,19 +1523,11 @@ then kill the related ftp process." (defun ange-ftp-quote-string (string) "Quote any characters in STRING that may confuse the ftp process." - (apply 'concat - (mapcar (lambda (char) - ;; This is said to be wrong; ftp is said to - ;; need quoting only for ", and that by doubling it. - ;; But experiment says this kind of quoting is correct - ;; when talking to ftp on GNU/Linux systems. - (if (or (<= char ? ) - (> char ?\~) - (= char ?\") - (= char ?\\)) - (vector ?\\ char) - (vector char))) - string))) + ;; This is said to be wrong; ftp is said to need quoting only for ", + ;; and that by doubling it. But experiment says UNIX-style kind of + ;; quoting is correct when talking to ftp on GNU/Linux systems, and + ;; W32-style kind of quoting on, yes, W32 systems. + (when (stringp string) (shell-quote-argument string))) (defun ange-ftp-barf-if-not-directory (directory) (or (file-directory-p directory) @@ -3766,7 +3758,7 @@ Value is (0 0) if the modification time cannot be determined." (ange-ftp-send-cmd t-host t-user - (list 'put (or temp2 filename) t-name) + (list 'put (or temp2 (ange-ftp-quote-string filename)) t-name) (or msg (if (and temp2 f-parsed) (format "Putting %s" newname) |