Skip to content

Commit 883b349

Browse files
committed
* lisp/net/tramp.el (tramp-file-local-name): Remove `save-match-data'.
1 parent c01f55f commit 883b349

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lisp/net/tramp.el

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,14 +1339,14 @@ entry does not exist, return nil."
13391339
"Return the local name component of NAME.
13401340
This function removes from NAME the specification of the remote
13411341
host and the method of accessing the host, leaving only the part
1342-
that identifies NAME locally on the remote system. NAME must be
1343-
a string that matches `tramp-file-name-regexp'. The returned
1344-
file name can be used directly as argument of `process-file',
1345-
`start-file-process', or `shell-command'."
1346-
(save-match-data
1347-
(and (tramp-tramp-file-p name)
1348-
(string-match (nth 0 tramp-file-name-structure) name)
1349-
(match-string (nth 4 tramp-file-name-structure) name))))
1342+
that identifies NAME locally on the remote system. If NAME does
1343+
not match `tramp-file-name-regexp', just NAME is returned. The
1344+
returned file name can be used directly as argument of
1345+
`process-file', `start-file-process', or `shell-command'."
1346+
(or (and (tramp-tramp-file-p name)
1347+
(string-match (nth 0 tramp-file-name-structure) name)
1348+
(match-string (nth 4 tramp-file-name-structure) name))
1349+
name))
13501350

13511351
(defun tramp-find-method (method user host)
13521352
"Return the right method string to use depending on USER and HOST.

0 commit comments

Comments
 (0)