From 7781ebe50f6d4daba02be3bd7e6ca08cd459674b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 1 Feb 2021 20:35:01 +0100 Subject: patch 8.2.2450: MS-Windows: ADS was not preserved if 'backupcopy' is "yes" Problem: MS-Windows: ADS was not preserved if 'backupcopy' is "yes". Solution: Copy ADS before truncating the file. (Ken Takata, closes #7762) --- src/bufwrite.c | 10 ++++------ src/version.c | 2 ++ 2 files changed, 6 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 @@ -1496,6 +1496,9 @@ buf_write( #endif #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) { diff --git a/src/version.c b/src/version.c index d34839c48..2ae792c87 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2450, /**/ 2449, /**/ -- cgit v1.2.1