[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5389b6a856b: Fix renaming symlinks on MS-Windows
From: |
Eli Zaretskii |
Subject: |
master 5389b6a856b: Fix renaming symlinks on MS-Windows |
Date: |
Sat, 13 Jul 2024 08:54:08 -0400 (EDT) |
branch: master
commit 5389b6a856b39427846e38b06fa398bafc04836a
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix renaming symlinks on MS-Windows
* src/w32.c (sys_rename_replace): Handle renames of a symlink.
This makes 'wdired-tests' succeed on MS-Windows.
---
src/w32.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/w32.c b/src/w32.c
index ab45ae8ec6b..6dcbbbcc61b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -4761,6 +4761,15 @@ sys_rename_replace (const char *oldname, const char
*newname, BOOL force)
strcpy (temp, map_w32_filename (oldname, NULL));
+ /* 'rename' (which calls MoveFileW) renames the _target_ of the
+ symlink, which is different from Posix behavior and not what we
+ want here. So in that case we pretend this is a cross-device move,
+ for which Frename_file already has a workaround. */
+ if (is_symlink (temp))
+ {
+ errno = EXDEV;
+ return -1;
+ }
/* volume_info is set indirectly by map_w32_filename. */
oldname_dev = volume_info.serialnum;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 5389b6a856b: Fix renaming symlinks on MS-Windows,
Eli Zaretskii <=