# HG changeset patch # User Bram Moolenaar # Date 1612208704 -3600 # Node ID e6b37eca27b66983fa85241780b9f0250e294ace # Parent 525c9e218c6934261ae1258097a4e9e4879c74b9 patch 8.2.2450: MS-Windows: ADS was not preserved if 'backupcopy' is "yes" Commit: https://github.com/vim/vim/commit/7781ebe50f6d4daba02be3bd7e6ca08cd459674b Author: Bram Moolenaar Date: Mon Feb 1 20:35:01 2021 +0100 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 https://github.com/vim/vim/issues/7762) diff --git a/src/bufwrite.c b/src/bufwrite.c --- 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) { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2450, +/**/ 2449, /**/ 2448,