From 93760219ce8bc689e931a190b18a9b9ed027f36d Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Mon, 25 May 2015 12:25:39 +0200 Subject: [PATCH] Fix IPv6 addresses in Tramp * lisp/net/tramp-sh.el (tramp-make-copy-program-file-name): Add sqare brackets around host name. Copyright-paperwork-exempt: yes --- lisp/net/tramp-sh.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 55ac778858c..265e7995378 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5125,12 +5125,14 @@ Return ATTR." "")) (defun tramp-make-copy-program-file-name (vec) - "Create a file name suitable to be passed to `scp' or `nc' and workalikes." + "Create a file name suitable for `scp', `pscp', or `nc' and workalikes." (let ((method (tramp-file-name-method vec)) (user (tramp-file-name-user vec)) (host (tramp-file-name-real-host vec)) (localname (tramp-shell-quote-argument (tramp-file-name-localname vec)))) + (when (string-match tramp-ipv6-regexp host) + (setq host (format "[%s]" host))) (cond ((tramp-get-method-parameter method 'tramp-remote-copy-program) localname) -- 2.39.2