From c929fb0ed882f15e492caff9f6610c87a57bca9a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Aug 2017 15:59:37 -0700 Subject: [PATCH] Improve rename-file behavior on DOS_NT See Bug#27986. * src/fileio.c (Frename_file): Do not worry about file name case sensitivity if DOS_NT, since renameat_noreplace should work in that case. --- src/fileio.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 9f6de5b6ca..f5000352ab 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2254,12 +2254,13 @@ This is what happens in interactive use with M-x. */) file = Fexpand_file_name (file, Qnil); - /* If the filesystem is case-insensitive and the file names are - identical but for case, treat it as a change-case request, and do - not worry whether NEWNAME exists or whether it is a directory, as - it is already another name for FILE. */ + /* If renameat_noreplace does not work and the filesystem is + case-insensitive and the file names are identical but for case, + treat it as a change-case request, and do not worry whether + NEWNAME exists or whether it is a directory, as it is already + another name for FILE. */ bool case_only_rename = false; -#if defined CYGWIN || defined DOS_NT +#ifdef CYGWIN if (!NILP (Ffile_name_case_insensitive_p (file))) { newname = Fexpand_file_name (newname, Qnil); -- 2.13.5