]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/ange-ftp.el (ange-ftp-quote-string): Use
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 13 Feb 2008 17:28:00 +0000 (17:28 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 13 Feb 2008 17:28:00 +0000 (17:28 +0000)
`shell-quote-argument'.  This DTRT even on w32 machines.
(ange-ftp-cf1): Quote FILENAME.

lisp/ChangeLog
lisp/net/ange-ftp.el

index cfd106aca27fffaa61b0b7379f0e5d36c09be2d8..d95e064f16491a7e56a2c5b340cb673bc629488c 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-13  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/ange-ftp.el (ange-ftp-quote-string): Use
+       `shell-quote-argument'.  This DTRT even on w32 machines.
+       (ange-ftp-cf1): Quote FILENAME.
+
 2008-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * smerge-mode.el (smerge-auto-combine-max-separation): New var.
index da62fc8bc749de6d051a9eb82759c68fce48f267..aeb2a8dc0d526036b3b2ea3f75f356e3954ab1e7 100644 (file)
@@ -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)