changeset 22642:f392093d562d

(ange-ftp-send-cmd): When listing a directory that contains space(s), cd to the directory first to avoid problems with (some) ftp servers.
author Richard M. Stallman <rms@gnu.org>
date Mon, 29 Jun 1998 17:29:15 +0000
parents 1c5197790616
children 4f99ccb85f3a
files lisp/ange-ftp.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ange-ftp.el	Mon Jun 29 17:23:25 1998 +0000
+++ b/lisp/ange-ftp.el	Mon Jun 29 17:29:15 1998 +0000
@@ -2244,6 +2244,14 @@
 	   (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