summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2016-11-12 19:00:35 -0500
committerKen Brown <kbrown@cornell.edu>2016-11-12 21:54:45 -0500
commit2809012c8f9485d8dc54b186f989f289b2797892 (patch)
tree6958ef0540eaada506c32f1546147a9fd26b8a3b /lisp/dired-aux.el
parent462804da9ce5a2ffc8c6ad4887d97116cf868d13 (diff)
downloademacs-2809012c8f9485d8dc54b186f989f289b2797892.tar.gz
Check case-sensitivity when renaming files
* src/fileio.c (file_name_case_insensitive_p) (Ffile_name_case_insensitive_p): New functions. (Frename_file): Allow renames that simply change case when the FILE argument is on a case-insensitive filesystem. (Bug#24441) * lisp/dired-aux.el (dired-do-create-files): Use 'file-name-case-insensitive-p' instead of 'system-type' to check for case-insensitivity. (Bug#24441) * doc/lispref/files.texi (Truenames): Document 'file-name-case-insensitive-p'.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 972b6b1ade0..f94e0537aa6 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1801,13 +1801,14 @@ Optional arg HOW-TO determines how to treat the target.
(concat (if dired-one-file op1 operation) " %s to: ")
target-dir op-symbol arg rfn-list default))))
(into-dir (cond ((null how-to)
- ;; Allow DOS/Windows users to change the letter
- ;; case of a directory. If we don't test these
- ;; conditions up front, file-directory-p below
- ;; will return t because the filesystem is
- ;; case-insensitive, and Emacs will try to move
+ ;; Allow users to change the letter case of
+ ;; a directory on a case-insensitive
+ ;; filesystem. If we don't test these
+ ;; conditions up front, file-directory-p
+ ;; below will return t on a case-insensitive
+ ;; filesystem, and Emacs will try to move
;; foo -> foo/foo, which fails.
- (if (and (memq system-type '(ms-dos windows-nt cygwin))
+ (if (and (file-name-case-insensitive-p (car fn-list))
(eq op-symbol 'move)
dired-one-file
(string= (downcase