From: Richard M. Stallman Date: Mon, 29 Jun 1998 17:29:15 +0000 (+0000) Subject: (ange-ftp-send-cmd): When listing a directory that X-Git-Tag: emacs-20.3~437 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5bc3ed3e8f69f8e38b0d7c736b7eb290fcc0f6c8;p=emacs.git (ange-ftp-send-cmd): When listing a directory that contains space(s), cd to the directory first to avoid problems with (some) ftp servers. --- diff --git a/lisp/ange-ftp.el b/lisp/ange-ftp.el index 6053d43a590..226ee04bb91 100644 --- a/lisp/ange-ftp.el +++ b/lisp/ange-ftp.el @@ -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