+2011-03-09 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Do
+ not use `tramp-file-name-port', because this returns also
+ `tramp-default-port'.
+
2011-03-09 Deniz Dogan <deniz.a.m.dogan@gmail.com>
* net/rcirc.el (rcirc-handler-001): Remove useless
'identity)
(if t2 (tramp-make-copy-program-file-name v) newname)))
- ;; Check for port number. Until now, there's no need for handling
- ;; like method, user, host.
- (setq host (tramp-file-name-real-host v)
- port (tramp-file-name-port v)
- port (or (and port (number-to-string port)) ""))
+ ;; Check for host and port number. We cannot use
+ ;; `tramp-file-name-port', because this returns also
+ ;; `tramp-default-port', which might clash with settings in
+ ;; "~/.ssh/config".
+ (setq host (tramp-file-name-host v)
+ port "")
+ (when (string-match tramp-host-with-port-regexp host)
+ (setq host (string-to-number (match-string 1 host))
+ port (string-to-number (match-string 2 host))))
;; Compose copy command.
(setq spec (format-spec-make
copy-args
(delete
;; " " has either been a replacement of "%k" (when
- ;; keep-date argument is non-nil), or a replacemtent
+ ;; keep-date argument is non-nil), or a replacement
;; for the whole keep-date sublist.
" "
(dolist
(append
copy-args
(let ((y (mapcar (lambda (z) (format-spec z spec)) x)))
- (if (zerop (length (car y))) '(" ") y))))))
+ (if (member "" y) '(" ") y))))))
copy-env
(delq
nil