0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2021-02-01 20:35:01 +01:00
parent 3b69006973
commit 7781ebe50f
2 changed files with 6 additions and 6 deletions

View File

@@ -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)
{

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2450,
/**/
2449,
/**/