comparison lisp/net/ange-ftp.el @ 64862:15e2ef5c7c16

* lisp/net/ange-ftp.el (ange-ftp-send-cmd): Make it work properly with uploading files. (ange-ftp-canonize-filename): Handle file names beginning with ~ correctly.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 09 Aug 2005 21:00:39 +0000
parents 34bd8e434dd7
children 63dd464bce2d
comparison
equal deleted inserted replaced
64861:7a8556a71193 64862:15e2ef5c7c16
2326 (unless (memq host-type ange-ftp-dumb-host-types) 2326 (unless (memq host-type ange-ftp-dumb-host-types)
2327 (setq cmd0 'ls) 2327 (setq cmd0 'ls)
2328 ;; We cd and then use `ls' with no directory argument. 2328 ;; We cd and then use `ls' with no directory argument.
2329 ;; This works around a misfeature of some versions of netbsd ftpd. 2329 ;; This works around a misfeature of some versions of netbsd ftpd.
2330 (unless (equal cmd1 ".") 2330 (unless (equal cmd1 ".")
2331 (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror))) 2331 (setq result (ange-ftp-cd host user
2332 (setq cmd1 cmd3))) 2332 ;; Make sure the target to which
2333 ;; `cd' is performed is a directory.
2334 (file-name-directory (nth 1 cmd))
2335 'noerror)))
2336 ;; Concatenate the switches and the target to be used with `ls'.
2337 (setq cmd1 (concat "\"" cmd3 " " cmd1 "\""))))
2333 2338
2334 ;; First argument is the remote name 2339 ;; First argument is the remote name
2335 ((progn 2340 ((progn
2336 (setq fix-name-func (or (cdr (assq host-type 2341 (setq fix-name-func (or (cdr (assq host-type
2337 ange-ftp-fix-name-func-alist)) 2342 ange-ftp-fix-name-func-alist))
3120 ((string-match "^~[^/]*" name) 3125 ((string-match "^~[^/]*" name)
3121 (let* ((tilda (match-string 0 name)) 3126 (let* ((tilda (match-string 0 name))
3122 (rest (substring name (match-end 0))) 3127 (rest (substring name (match-end 0)))
3123 (dir (ange-ftp-expand-dir host user tilda))) 3128 (dir (ange-ftp-expand-dir host user tilda)))
3124 (if dir 3129 (if dir
3125 (setq name (if (string-equal dir "/") 3130 (setq name (cond ((string-equal rest "")
3126 rest (concat dir rest))) 3131 dir)
3132 ((string-equal dir "/")
3133 rest)
3134 (t
3135 (concat dir rest))))
3127 (error "User \"%s\" is not known" 3136 (error "User \"%s\" is not known"
3128 (substring tilda 1))))) 3137 (substring tilda 1)))))
3129 3138
3130 ;; relative name. Tack on homedir and re-expand. 3139 ;; relative name. Tack on homedir and re-expand.
3131 (t 3140 (t