mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
vim-patch:8.1.1349: if writing runs into conversion error backup file is deleted
Problem: If writing runs into a conversion error the backup file is
deleted. (Arseny Nasokin)
Solution: Don't delete the backup file is the file was overwritten and a
conversion error occurred. (Christian Brabandt, closes vim/vim#4387)
cf0bfd9ade
This commit is contained in:
@@ -3693,9 +3693,11 @@ restore_backup:
|
||||
/*
|
||||
* Remove the backup unless 'backup' option is set
|
||||
*/
|
||||
if (!p_bk && backup != NULL && os_remove((char *)backup) != 0)
|
||||
if (!p_bk && backup != NULL
|
||||
&& !write_info.bw_conv_error
|
||||
&& os_remove((char *)backup) != 0) {
|
||||
EMSG(_("E207: Can't delete backup file"));
|
||||
|
||||
}
|
||||
|
||||
goto nofail;
|
||||
|
||||
|
Reference in New Issue
Block a user