]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/tramp.el (tramp-tramp-file-p): Use `string-match-p'.
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 4 Oct 2017 09:48:37 +0000 (11:48 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 4 Oct 2017 09:48:37 +0000 (11:48 +0200)
Reported by ClĂ©ment Pit-Claudel <cpitclaudel@gmail.com>.

lisp/net/tramp.el

index ac882abae549096f3968c4fc2e7bf7e52184f86c..c8b6e68f719c50e7f1794987c2853b905c1dbeea 100644 (file)
@@ -1269,14 +1269,14 @@ entry does not exist, return nil."
 ;;;###tramp-autoload
 (defun tramp-tramp-file-p (name)
   "Return t if NAME is a string with Tramp file name syntax."
-  (save-match-data
-    (and (stringp name)
-        ;; No "/:" and "/c:".  This is not covered by `tramp-file-name-regexp'.
-        (not (string-match
-              (if (memq system-type '(cygwin windows-nt))
-                  "^/[[:alpha:]]?:" "^/:")
-              name))
-        (string-match tramp-file-name-regexp name))))
+  (and (stringp name)
+       ;; No "/:" and "/c:".  This is not covered by `tramp-file-name-regexp'.
+       (not (string-match-p
+            (if (memq system-type '(cygwin windows-nt))
+                "^/[[:alpha:]]?:" "^/:")
+            name))
+       (string-match-p tramp-file-name-regexp name)
+       t))
 
 (defun tramp-find-method (method user host)
   "Return the right method string to use.