]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-send-cmd): When listing a directory that
authorRichard M. Stallman <rms@gnu.org>
Mon, 29 Jun 1998 17:29:15 +0000 (17:29 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 29 Jun 1998 17:29:15 +0000 (17:29 +0000)
contains space(s), cd to the directory first to avoid problems
with (some) ftp servers.

lisp/ange-ftp.el

index 6053d43a5905a2e6b02af065ec8b172224aa4d6e..226ee04bb91c667b3c4337ad84f4b28770dcaa3b 100644 (file)
@@ -2244,6 +2244,14 @@ and NOWAIT."
           (string-match "/$" cmd1)
           (not (string-match "R" cmd3))
           (setq cmd1 (concat cmd1 ".")))
+
+      ;; If the dir name contains a space, some ftp servers will
+      ;; refuse to list it.  We instead change directory to the
+      ;; directory in question and ls ".".
+      (when (string-match " " cmd1)
+       (ange-ftp-cd host user (nth 1 cmd))
+       (setq cmd1 "."))
+
       ;; If the remote ls can take switches, put them in
       (or (memq host-type ange-ftp-dumb-host-types)
          (setq cmd0 'ls