From: Michael Albinus Date: Wed, 9 Mar 2011 11:04:27 +0000 (+0100) Subject: * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Do X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~628 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee545c35d2e83306d50ec78a8d9173ab9011bce5;p=emacs.git * 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'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 251547b617d..df4834a27c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-03-09 Michael Albinus + + * 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 * net/rcirc.el (rcirc-handler-001): Remove useless diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 63a4c19eccf..ec75ea78fe1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2251,11 +2251,15 @@ The method used must be an out-of-band method." '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 @@ -2270,7 +2274,7 @@ The method used must be an out-of-band method." 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 @@ -2281,7 +2285,7 @@ The method used must be an out-of-band method." (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