updated for version 7.3.1182
Problem: 'backupcopy' default on MS-Windows does not work for hard and soft
links.
Solution: Check for links. (David Pope, Ken Takata)
diff --git a/src/fileio.c b/src/fileio.c
index 6665c3a..6c8cba1 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3780,12 +3780,12 @@
}
}
-# ifdef UNIX
/*
* Break symlinks and/or hardlinks if we've been asked to.
*/
if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK))
{
+# ifdef UNIX
int lstat_res;
lstat_res = mch_lstat((char *)fname, &st);
@@ -3801,8 +3801,18 @@
&& st_old.st_nlink > 1
&& (lstat_res != 0 || st.st_ino == st_old.st_ino))
backup_copy = FALSE;
+# else
+# if defined(WIN32)
+ /* Symlinks. */
+ if ((bkc_flags & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
+ backup_copy = FALSE;
+
+ /* Hardlinks. */
+ if ((bkc_flags & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
+ backup_copy = FALSE;
+# endif
+# endif
}
-#endif
#endif