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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user