emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108064: Fix bug #11827 with file-


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108064: Fix bug #11827 with file-relative-name on MS-Windows.
Date: Sun, 01 Jul 2012 19:38:53 +0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108064
fixes bug: http://debbugs.gnu.org/11827
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Sun 2012-07-01 19:38:53 +0300
message:
  Fix bug #11827 with file-relative-name on MS-Windows.
  
   lisp/files.el (file-relative-name): Compare file names
   case-insensitively if on MS-Windows or MS-DOS, or if
   read-file-name-completion-ignore-case is non-nil.  Don't use
   case-fold-search for this purpose.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-06-28 12:13:38 +0000
+++ b/lisp/ChangeLog    2012-07-01 16:38:53 +0000
@@ -1,3 +1,10 @@
+2012-07-01  Eli Zaretskii  <address@hidden>
+
+       * files.el (file-relative-name): Compare file names
+       case-insensitively if on MS-Windows or MS-DOS, or if
+       read-file-name-completion-ignore-case is non-nil.  Don't use
+       case-fold-search for this purpose.  (Bug#11827)
+
 2012-06-28  Andreas Schwab  <address@hidden>
 
        * calendar/cal-dst.el (calendar-current-time-zone): Return

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2012-05-07 04:29:59 +0000
+++ b/lisp/files.el     2012-07-01 16:38:53 +0000
@@ -4310,7 +4310,9 @@
                                                        default-directory))))
     (setq filename (expand-file-name filename))
     (let ((fremote (file-remote-p filename))
-          (dremote (file-remote-p directory)))
+         (dremote (file-remote-p directory))
+         (fold-case (or (memq system-type '(ms-dos cygwin windows-nt))
+                        read-file-name-completion-ignore-case)))
       (if ;; Conditions for separate trees
          (or
           ;; Test for different filesystems on DOS/Windows
@@ -4319,7 +4321,7 @@
            (memq system-type '(ms-dos cygwin windows-nt))
            (or
             ;; Test for different drive letters
-            (not (eq t (compare-strings filename 0 2 directory 0 2)))
+            (not (eq t (compare-strings filename 0 2 directory 0 2 fold-case)))
             ;; Test for UNCs on different servers
             (not (eq t (compare-strings
                         (progn
@@ -4344,16 +4346,16 @@
           (while (not
                  (or
                   (eq t (compare-strings filename-dir nil (length directory)
-                                         directory nil nil case-fold-search))
+                                         directory nil nil fold-case))
                   (eq t (compare-strings filename nil (length directory)
-                                         directory nil nil case-fold-search))))
+                                         directory nil nil fold-case))))
             (setq directory (file-name-directory (substring directory 0 -1))
                  ancestor (if (equal ancestor ".")
                               ".."
                             (concat "../" ancestor))))
           ;; Now ancestor is empty, or .., or ../.., etc.
           (if (eq t (compare-strings filename nil (length directory)
-                                    directory nil nil case-fold-search))
+                                    directory nil nil fold-case))
              ;; We matched within FILENAME's directory part.
              ;; Add the rest of FILENAME onto ANCESTOR.
              (let ((rest (substring filename (length directory))))


reply via email to

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