diff options
| author | Stefan Monnier | 2004-03-26 15:04:35 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-03-26 15:04:35 +0000 |
| commit | 7c64272b8ce748ec4d046acc7689df0da84257cf (patch) | |
| tree | a3c889cc8155068111dbf284ae3778d8adfd2d38 | |
| parent | 79760fb2d09c7a8e0c4116925b6f57d8d8b1ba0d (diff) | |
| download | emacs-7c64272b8ce748ec4d046acc7689df0da84257cf.tar.gz emacs-7c64272b8ce748ec4d046acc7689df0da84257cf.zip | |
(file-relative-name): Use compare-strings.
| -rw-r--r-- | lisp/files.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/files.el b/lisp/files.el index 15f0f5e5179..a36006f2320 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; files.el --- file input and output commands for Emacs | 1 | ;;; files.el --- file input and output commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985,86,87,92,93,94,95,96,97,98,99,2000,01,02,2003 | 3 | ;; Copyright (C) 1985,86,87,92,93,94,95,96,97,98,99,2000,01,02,03,2004 |
| 4 | ;;; Free Software Foundation, Inc. | 4 | ;;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -2905,9 +2905,9 @@ on a DOS/Windows machine, it returns FILENAME on expanded form." | |||
| 2905 | (or | 2905 | (or |
| 2906 | ;; Test for different drives on DOS/Windows | 2906 | ;; Test for different drives on DOS/Windows |
| 2907 | (and | 2907 | (and |
| 2908 | ;; Should `cygwin' really be included here? --stef | ||
| 2908 | (memq system-type '(ms-dos cygwin windows-nt)) | 2909 | (memq system-type '(ms-dos cygwin windows-nt)) |
| 2909 | (not (string-equal (substring filename 0 2) | 2910 | (not (eq t (compare-strings filename 0 2 directory 0 2)))) |
| 2910 | (substring directory 0 2)))) | ||
| 2911 | ;; Test for different remote file handlers | 2911 | ;; Test for different remote file handlers |
| 2912 | (not (eq hf hd)) | 2912 | (not (eq hf hd)) |
| 2913 | ;; Test for different remote file system identification | 2913 | ;; Test for different remote file system identification |
| @@ -2925,18 +2925,19 @@ on a DOS/Windows machine, it returns FILENAME on expanded form." | |||
| 2925 | filename | 2925 | filename |
| 2926 | (let ((ancestor ".") | 2926 | (let ((ancestor ".") |
| 2927 | (filename-dir (file-name-as-directory filename))) | 2927 | (filename-dir (file-name-as-directory filename))) |
| 2928 | (while | 2928 | (while (not |
| 2929 | (and | 2929 | (or |
| 2930 | (not (string-match (concat "\\`" (regexp-quote directory)) | 2930 | (eq t (compare-strings filename-dir nil (length directory) |
| 2931 | filename-dir)) | 2931 | directory nil nil case-fold-search)) |
| 2932 | (not (string-match (concat "\\`" (regexp-quote directory)) | 2932 | (eq t (compare-strings filename nil (length directory) |
| 2933 | filename))) | 2933 | directory nil nil case-fold-search)))) |
| 2934 | (setq directory (file-name-directory (substring directory 0 -1)) | 2934 | (setq directory (file-name-directory (substring directory 0 -1)) |
| 2935 | ancestor (if (equal ancestor ".") | 2935 | ancestor (if (equal ancestor ".") |
| 2936 | ".." | 2936 | ".." |
| 2937 | (concat "../" ancestor)))) | 2937 | (concat "../" ancestor)))) |
| 2938 | ;; Now ancestor is empty, or .., or ../.., etc. | 2938 | ;; Now ancestor is empty, or .., or ../.., etc. |
| 2939 | (if (string-match (concat "^" (regexp-quote directory)) filename) | 2939 | (if (eq t (compare-strings filename nil (length directory) |
| 2940 | directory nil nil case-fold-search)) | ||
| 2940 | ;; We matched within FILENAME's directory part. | 2941 | ;; We matched within FILENAME's directory part. |
| 2941 | ;; Add the rest of FILENAME onto ANCESTOR. | 2942 | ;; Add the rest of FILENAME onto ANCESTOR. |
| 2942 | (let ((rest (substring filename (match-end 0)))) | 2943 | (let ((rest (substring filename (match-end 0)))) |