emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/net tramp.el


From: Michael Albinus
Subject: [Emacs-diffs] emacs/lisp/net tramp.el
Date: Thu, 08 Oct 2009 15:19:57 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       09/10/08 15:19:57

Modified files:
        lisp/net       : tramp.el 

Log message:
        * net/tramp.el (tramp-file-name-real-user, tramp-file-name-domain)
        (tramp-file-name-real-host, tramp-file-name-port): Apply
        `save-match-data.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/tramp.el?cvsroot=emacs&r1=1.259&r2=1.260

Patches:
Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.259
retrieving revision 1.260
diff -u -b -r1.259 -r1.260
--- tramp.el    6 Oct 2009 02:50:48 -0000       1.259
+++ tramp.el    8 Oct 2009 15:19:56 -0000       1.260
@@ -3905,11 +3905,11 @@
       (while (string-match "//" localname)
        (setq localname (replace-match "/" t t localname)))
       ;; No tilde characters in file name, do normal
-      ;; expand-file-name (this does "/./" and "/../").  We bind
-      ;; `directory-sep-char' here for XEmacs on Windows, which
-      ;; would otherwise use backslash.  `default-directory' is
-      ;; bound, because on Windows there would be problems with UNC
-      ;; shares or Cygwin mounts.
+      ;; `expand-file-name' (this does "/./" and "/../").  We bind
+      ;; `directory-sep-char' here for XEmacs on Windows, which would
+      ;; otherwise use backslash.  `default-directory' is bound,
+      ;; because on Windows there would be problems with UNC shares or
+      ;; Cygwin mounts.
       (let ((directory-sep-char ?/)
            (default-directory (tramp-compat-temporary-file-directory)))
        (tramp-make-tramp-file-name
@@ -7296,35 +7296,39 @@
 ;; "user%domain".  Sometimes, we must extract these parts.
 (defun tramp-file-name-real-user (vec)
   "Return the user name of VEC without domain."
+  (save-match-data
   (let ((user (tramp-file-name-user vec)))
     (if (and (stringp user)
             (string-match tramp-user-with-domain-regexp user))
        (match-string 1 user)
-      user)))
+       user))))
 
 (defun tramp-file-name-domain (vec)
   "Return the domain name of VEC."
+  (save-match-data
   (let ((user (tramp-file-name-user vec)))
     (and (stringp user)
         (string-match tramp-user-with-domain-regexp user)
-        (match-string 2 user))))
+          (match-string 2 user)))))
 
 ;; The host part of a Tramp file name vector can be of kind
 ;; "host#port".  Sometimes, we must extract these parts.
 (defun tramp-file-name-real-host (vec)
   "Return the host name of VEC without port."
+  (save-match-data
   (let ((host (tramp-file-name-host vec)))
     (if (and (stringp host)
             (string-match tramp-host-with-port-regexp host))
        (match-string 1 host)
-      host)))
+       host))))
 
 (defun tramp-file-name-port (vec)
   "Return the port number of VEC."
+  (save-match-data
   (let ((host (tramp-file-name-host vec)))
     (and (stringp host)
         (string-match tramp-host-with-port-regexp host)
-        (string-to-number (match-string 2 host)))))
+          (string-to-number (match-string 2 host))))))
 
 (defun tramp-tramp-file-p (name)
   "Return t if NAME is a Tramp file."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]