# HG changeset patch # User Michael Albinus # Date 1202923658 0 # Node ID c1e1558393ba439803f1077d0f4937c659d197d2 # Parent ca1e1298a3d8ebc04dffb7c912cfb31489c9f6c0 * net/ange-ftp.el (ange-ftp-quote-string): Use `shell-quote-argument'. This DTRT even on w32 machines. (ange-ftp-cf1): Quote FILENAME. diff -r ca1e1298a3d8 -r c1e1558393ba lisp/net/ange-ftp.el --- a/lisp/net/ange-ftp.el Wed Feb 13 15:10:57 2008 +0000 +++ b/lisp/net/ange-ftp.el Wed Feb 13 17:27:38 2008 +0000 @@ -1523,19 +1523,11 @@ (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 @@ (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)