summaryrefslogtreecommitdiff
path: root/src/bufwrite.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-02-01 20:35:01 +0100
committerBram Moolenaar <Bram@vim.org>2021-02-01 20:35:01 +0100
commit7781ebe50f6d4daba02be3bd7e6ca08cd459674b (patch)
tree2e6ed785ad9f60b56516964ae8e2afce56249ea3 /src/bufwrite.c
parent3b690069730805a147d45d92eaca4dc838272d1d (diff)
downloadvim-git-7781ebe50f6d4daba02be3bd7e6ca08cd459674b.tar.gz
patch 8.2.2450: MS-Windows: ADS was not preserved if 'backupcopy' is "yes"v8.2.2450
Problem: MS-Windows: ADS was not preserved if 'backupcopy' is "yes". Solution: Copy ADS before truncating the file. (Ken Takata, closes #7762)
Diffstat (limited to 'src/bufwrite.c')
-rw-r--r--src/bufwrite.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bufwrite.c b/src/bufwrite.c
index d7c74de35..c7c832cff 100644
--- a/src/bufwrite.c
+++ b/src/bufwrite.c
@@ -1497,6 +1497,9 @@ buf_write(
#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
mch_copy_sec(fname, backup);
#endif
+#ifdef MSWIN
+ (void)mch_copy_file_attribute(fname, backup);
+#endif
break;
}
}
@@ -1909,12 +1912,7 @@ restore_backup:
#if defined(MSWIN)
if (backup != NULL && overwriting && !append)
- {
- if (backup_copy)
- (void)mch_copy_file_attribute(wfname, backup);
- else
- (void)mch_copy_file_attribute(backup, wfname);
- }
+ (void)mch_copy_file_attribute(backup, wfname);
if (!overwriting && !append)
{