Mercurial > vim
changeset 23817:e6b37eca27b6 v8.2.2450
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 <Bram@vim.org>
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 01 Feb 2021 20:45:04 +0100 |
parents | 525c9e218c69 |
children | 8103ec7fda36 |
files | src/bufwrite.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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) {