summaryrefslogtreecommitdiff
path: root/lisp/net/ange-ftp.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-05-20 18:51:49 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-05-20 18:51:49 +0000
commit7ca26b02cfe1f8942faac526e8f3b1143d2c78d0 (patch)
tree4b949665c43f377f8cbe607e5c05154ae60b235a /lisp/net/ange-ftp.el
parent4ead48d7c5f13748750c0aa7319d5b501a8ed947 (diff)
downloademacs-7ca26b02cfe1f8942faac526e8f3b1143d2c78d0.tar.gz
(ange-ftp-generate-root-prefixes)
(ange-ftp-file-name-completion): Don't cons unnecessarily. (ange-ftp-send-cmd): Always `cd' before doing `ls'.
Diffstat (limited to 'lisp/net/ange-ftp.el')
-rw-r--r--lisp/net/ange-ftp.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 720255726ad..dde35b017e3 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1459,13 +1459,11 @@ only return the directory part of FILE."
(if (string-match "^[^/]*\\(/\\).*$" key)
(let ((host (substring key 0 (match-beginning 1)))
(user (substring key (match-end 1))))
- (setq res (cons (list (concat user "@" host ":"))
- res))))))
+ (push (concat user "@" host ":") res)))))
ange-ftp-passwd-hashtable)
(ange-ftp-map-hashtable
(function (lambda (host user)
- (setq res (cons (list (concat host ":"))
- res))))
+ (push (concat host ":") res)))
ange-ftp-user-hashtable)
(or res (list nil)))))
@@ -2357,9 +2355,13 @@ and NOWAIT."
(setq cmd1 "."))
;; If the remote ls can take switches, put them in
- (or (memq host-type ange-ftp-dumb-host-types)
- (setq cmd0 'ls
- cmd1 (format "\"%s %s\"" cmd3 cmd1))))
+ (unless (memq host-type ange-ftp-dumb-host-types)
+ (setq cmd0 'ls)
+ ;; We cd and then use `ls' with no directory argument.
+ ;; This works around a misfeature of some versions of netbsd ftpd.
+ (unless (equal cmd1 ".")
+ (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror)))
+ (setq cmd1 cmd3)))
;; First argument is the remote name
((progn
@@ -4077,9 +4079,8 @@ E.g.,
(try-completion
file
(nconc (ange-ftp-generate-root-prefixes)
- (mapcar 'list
- (ange-ftp-real-file-name-all-completions
- file ange-ftp-this-dir))))
+ (ange-ftp-real-file-name-all-completions
+ file ange-ftp-this-dir)))
(ange-ftp-real-file-name-completion file ange-ftp-this-dir)))))