platforms, if the old and new names are identical but for the letter-case.
CHECK_STRING (newname);
file = Fexpand_file_name (file, Qnil);
- if (!NILP (Ffile_directory_p (newname)))
+ if ((!NILP (Ffile_directory_p (newname)))
+#ifdef DOS_NT
+ /* If the file names are identical but for the case,
+ don't attempt to move directory to itself. */
+ && (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname))))
+#endif
+ )
newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
else
newname = Fexpand_file_name (newname, Qnil);