* lisp/net/tramp.el (tramp-file-local-name): Remove `save-match-data'.

This commit is contained in:
Michael Albinus 2020-01-07 13:10:35 +01:00
parent c01f55f126
commit 883b3490d8

View file

@ -1339,14 +1339,14 @@ entry does not exist, return nil."
"Return the local name component of NAME. "Return the local name component of NAME.
This function removes from NAME the specification of the remote This function removes from NAME the specification of the remote
host and the method of accessing the host, leaving only the part host and the method of accessing the host, leaving only the part
that identifies NAME locally on the remote system. NAME must be that identifies NAME locally on the remote system. If NAME does
a string that matches `tramp-file-name-regexp'. The returned not match `tramp-file-name-regexp', just NAME is returned. The
file name can be used directly as argument of `process-file', returned file name can be used directly as argument of
`start-file-process', or `shell-command'." `process-file', `start-file-process', or `shell-command'."
(save-match-data (or (and (tramp-tramp-file-p name)
(and (tramp-tramp-file-p name) (string-match (nth 0 tramp-file-name-structure) name)
(string-match (nth 0 tramp-file-name-structure) name) (match-string (nth 4 tramp-file-name-structure) name))
(match-string (nth 4 tramp-file-name-structure) name)))) name))
(defun tramp-find-method (method user host) (defun tramp-find-method (method user host)
"Return the right method string to use depending on USER and HOST. "Return the right method string to use depending on USER and HOST.