aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el11
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8df640a3c99..a320976a74f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-03-01 Michael Albinus <michael.albinus@gmx.de>
2
3 * files.el (file-equal-p): Fix docstring. Avoid unnecessary
4 access of FILE2, if FILE1 does not exist.
5
12012-03-01 Michael R. Mauger <mmaug@yahoo.com> 62012-03-01 Michael R. Mauger <mmaug@yahoo.com>
2 7
3 * progmodes/sql.el: Bug fix 8 * progmodes/sql.el: Bug fix
diff --git a/lisp/files.el b/lisp/files.el
index 0d687a157fe..88ebb9eaab4 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4986,15 +4986,16 @@ given. With a prefix argument, TRASH is nil."
4986 (delete-directory-internal directory))))) 4986 (delete-directory-internal directory)))))
4987 4987
4988(defun file-equal-p (file1 file2) 4988(defun file-equal-p (file1 file2)
4989 "Return non-nil if existing files FILE1 and FILE2 name the same file. 4989 "Return non-nil if files FILE1 and FILE2 name the same file.
4990Return nil if one or both files doesn't exists." 4990If FILE1 or FILE2 does not exist, the return value is unspecified."
4991 (let ((handler (or (find-file-name-handler file1 'file-equal-p) 4991 (let ((handler (or (find-file-name-handler file1 'file-equal-p)
4992 (find-file-name-handler file2 'file-equal-p)))) 4992 (find-file-name-handler file2 'file-equal-p))))
4993 (if handler 4993 (if handler
4994 (funcall handler 'file-equal-p file1 file2) 4994 (funcall handler 'file-equal-p file1 file2)
4995 (let ((f1-attr (file-attributes (file-truename file1))) 4995 (let (f1-attr f2-attr)
4996 (f2-attr (file-attributes (file-truename file2)))) 4996 (and (setq f1-attr (file-attributes (file-truename file1)))
4997 (and f1-attr f2-attr (equal f1-attr f2-attr)))))) 4997 (setq f2-attr (file-attributes (file-truename file2)))
4998 (equal f1-attr f2-attr))))))
4998 4999
4999(defun file-subdir-of-p (dir1 dir2) 5000(defun file-subdir-of-p (dir1 dir2)
5000 "Return non-nil if DIR1 is a subdirectory of DIR2. 5001 "Return non-nil if DIR1 is a subdirectory of DIR2.