Commit 7ca26b02 authored by Stefan Monnier's avatar Stefan Monnier

(ange-ftp-generate-root-prefixes)

(ange-ftp-file-name-completion): Don't cons unnecessarily.
(ange-ftp-send-cmd): Always `cd' before doing `ls'.
parent 4ead48d7
...@@ -1459,13 +1459,11 @@ only return the directory part of FILE." ...@@ -1459,13 +1459,11 @@ only return the directory part of FILE."
(if (string-match "^[^/]*\\(/\\).*$" key) (if (string-match "^[^/]*\\(/\\).*$" key)
(let ((host (substring key 0 (match-beginning 1))) (let ((host (substring key 0 (match-beginning 1)))
(user (substring key (match-end 1)))) (user (substring key (match-end 1))))
(setq res (cons (list (concat user "@" host ":")) (push (concat user "@" host ":") res)))))
res))))))
ange-ftp-passwd-hashtable) ange-ftp-passwd-hashtable)
(ange-ftp-map-hashtable (ange-ftp-map-hashtable
(function (lambda (host user) (function (lambda (host user)
(setq res (cons (list (concat host ":")) (push (concat host ":") res)))
res))))
ange-ftp-user-hashtable) ange-ftp-user-hashtable)
(or res (list nil))))) (or res (list nil)))))
...@@ -2357,9 +2355,13 @@ and NOWAIT." ...@@ -2357,9 +2355,13 @@ and NOWAIT."
(setq cmd1 ".")) (setq cmd1 "."))
;; If the remote ls can take switches, put them in ;; If the remote ls can take switches, put them in
(or (memq host-type ange-ftp-dumb-host-types) (unless (memq host-type ange-ftp-dumb-host-types)
(setq cmd0 'ls (setq cmd0 'ls)
cmd1 (format "\"%s %s\"" cmd3 cmd1)))) ;; 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 ;; First argument is the remote name
((progn ((progn
...@@ -4077,9 +4079,8 @@ E.g., ...@@ -4077,9 +4079,8 @@ E.g.,
(try-completion (try-completion
file file
(nconc (ange-ftp-generate-root-prefixes) (nconc (ange-ftp-generate-root-prefixes)
(mapcar 'list (ange-ftp-real-file-name-all-completions
(ange-ftp-real-file-name-all-completions file ange-ftp-this-dir)))
file ange-ftp-this-dir))))
(ange-ftp-real-file-name-completion file ange-ftp-this-dir))))) (ange-ftp-real-file-name-completion file ange-ftp-this-dir)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment