emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100261: Fix bug #4674 with UNCs i


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100261: Fix bug #4674 with UNCs in file-relative-name.
Date: Sat, 04 Dec 2010 14:52:04 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100261
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-23
timestamp: Sat 2010-12-04 14:52:04 +0200
message:
  Fix bug #4674 with UNCs in file-relative-name.
  
   files.el (file-relative-name): Handle UNC file names on DOS/Windows.
   Also fixes bug#4673.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-12-02 07:40:32 +0000
+++ b/lisp/ChangeLog    2010-12-04 12:52:04 +0000
@@ -1,3 +1,8 @@
+2010-12-04  Eli Zaretskii  <address@hidden>
+
+       * files.el (file-relative-name): Handle UNC file names on
+       DOS/Windows.  (Bug#4674)
+
 2010-12-02  Glenn Morris  <address@hidden>
 
        * ps-print.el (ps-line-lengths-internal, ps-nb-pages):

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2010-11-11 22:19:01 +0000
+++ b/lisp/files.el     2010-12-04 12:52:04 +0000
@@ -4054,11 +4054,29 @@
           (dremote (file-remote-p directory)))
       (if ;; Conditions for separate trees
          (or
-          ;; Test for different drives on DOS/Windows
+          ;; Test for different filesystems on DOS/Windows
           (and
            ;; Should `cygwin' really be included here?  --stef
            (memq system-type '(ms-dos cygwin windows-nt))
-           (not (eq t (compare-strings filename 0 2 directory 0 2))))
+           (or
+            ;; Test for different drive letters
+            (not (eq t (compare-strings filename 0 2 directory 0 2)))
+            ;; Test for UNCs on different servers
+            (not (eq t (compare-strings
+                        (progn
+                          (if (string-match "\\`//\\([^:/]+\\)/" filename)
+                              (match-string 1 filename)
+                            ;; Windows file names cannot have ? in
+                            ;; them, so use that to detect when
+                            ;; neither FILENAME nor DIRECTORY is a
+                            ;; UNC.
+                            "?"))
+                        0 nil
+                        (progn
+                          (if (string-match "\\`//\\([^:/]+\\)/" directory)
+                              (match-string 1 directory)
+                            "?"))
+                        0 nil t)))))
           ;; Test for different remote file system identification
           (not (equal fremote dremote)))
          filename


reply via email to

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