Commit ca1ddef2 authored by Michael Albinus's avatar Michael Albinus
Browse files

Tramp: fix location of files on W32

* lisp/net/tramp.el:
* lisp/net/tramp-sh.el: Use (eq system-type 'windows-nt) where appropriate.
(tramp-completion-function-alist-ssh): Fix location of files on W32.
parent c975258a
Pipeline #10224 passed with stages
in 9 minutes and 38 seconds
......@@ -401,16 +401,34 @@ The string is used in `tramp-methods'.")
;;;###tramp-autoload
(defconst tramp-completion-function-alist-ssh
'((tramp-parse-rhosts "/etc/hosts.equiv")
`((tramp-parse-rhosts "/etc/hosts.equiv")
(tramp-parse-rhosts "/etc/shosts.equiv")
(tramp-parse-shosts "/etc/ssh_known_hosts")
(tramp-parse-sconfig "/etc/ssh_config")
;; On W32 systems, the ssh directory is located somewhere else.
(tramp-parse-shosts ,(expand-file-name
"ssh/ssh_known_hosts"
(or (and (eq system-type 'windows-nt)
(getenv "ProgramData"))
"/etc/")))
(tramp-parse-sconfig ,(expand-file-name
"ssh/ssh_config"
(or (and (eq system-type 'windows-nt)
(getenv "ProgramData"))
"/etc/")))
(tramp-parse-shostkeys "/etc/ssh2/hostkeys")
(tramp-parse-sknownhosts "/etc/ssh2/knownhosts")
(tramp-parse-rhosts "~/.rhosts")
(tramp-parse-rhosts "~/.shosts")
(tramp-parse-shosts "~/.ssh/known_hosts")
(tramp-parse-sconfig "~/.ssh/config")
;; On W32 systems, the .ssh directory is located somewhere else.
(tramp-parse-shosts ,(expand-file-name
".ssh/known_hosts"
(or (and (eq system-type 'windows-nt)
(getenv "USERPROFILE"))
"~/")))
(tramp-parse-sconfig ,(expand-file-name
".ssh/config"
(or (and (eq system-type 'windows-nt)
(getenv "USERPROFILE"))
"~/")))
(tramp-parse-shostkeys "~/.ssh2/hostkeys")
(tramp-parse-sknownhosts "~/.ssh2/knownhosts"))
"Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")
......@@ -433,7 +451,7 @@ The string is used in `tramp-methods'.")
;;;###tramp-autoload
(defconst tramp-completion-function-alist-putty
`((tramp-parse-putty
,(if (memq system-type '(windows-nt))
,(if (eq system-type 'windows-nt)
"HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions"
"~/.putty/sessions")))
"Default list of (FUNCTION REGISTRY) pairs to be examined for putty sessions.")
......@@ -5764,7 +5782,7 @@ function cell is returned to be applied on a buffer."
;; slashes as directory separators.
(cond
((and (string-match-p "local" prop)
(memq system-type '(windows-nt)))
(eq system-type 'windows-nt))
"(%s | \"%s\")")
((string-match-p "local" prop) "(%s | %s)")
(t "(%s | %s >%%s)"))
......@@ -5775,7 +5793,7 @@ function cell is returned to be applied on a buffer."
;; the pipe symbol be quoted if they use forward
;; slashes as directory separators.
(if (and (string-match-p "local" prop)
(memq system-type '(windows-nt)))
(eq system-type 'windows-nt))
"(%s <%%s | \"%s\")"
"(%s <%%s | %s)")
compress coding))
......
......@@ -488,7 +488,7 @@ interpreted as a regular expression which always matches."
;; either lower case or upper case letters. See
;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38079#20>.
(defcustom tramp-restricted-shell-hosts-alist
(when (memq system-type '(windows-nt))
(when (eq system-type 'windows-nt)
(list (format "\\`\\(%s\\|%s\\)\\'"
(regexp-quote (downcase tramp-system-name))
(regexp-quote (upcase tramp-system-name)))))
......@@ -558,7 +558,7 @@ usually suffice.")
the remote shell.")
(defcustom tramp-local-end-of-line
(if (memq system-type '(windows-nt)) "\r\n" "\n")
(if (eq system-type 'windows-nt) "\r\n" "\n")
"String used for end of line in local processes."
:version "24.1"
:type 'string)
......@@ -3138,7 +3138,7 @@ User may be nil."
(defun tramp-parse-putty (registry-or-dirname)
"Return a list of (user host) tuples allowed to access.
User is always nil."
(if (memq system-type '(windows-nt))
(if (eq system-type 'windows-nt)
(with-tramp-connection-property nil "parse-putty"
(with-temp-buffer
(when (zerop (tramp-call-process
......@@ -4990,7 +4990,7 @@ VEC is used for tracing."
(let ((candidates '("en_US.utf8" "C.utf8" "en_US.UTF-8"))
locale)
(with-temp-buffer
(unless (or (memq system-type '(windows-nt))
(unless (or (eq system-type 'windows-nt)
(not (zerop (tramp-call-process
nil "locale" nil t nil "-a"))))
(while candidates
......
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