1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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'.
This commit is contained in:
Ken Brown 2016-11-12 19:00:35 -05:00
parent 462804da9c
commit 2809012c8f
4 changed files with 111 additions and 20 deletions

View file

@ -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