mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
Remove old UNIX ifdef from buf_write()
When backupcopy=auto buf_write assumes backupcopy=yes when the file is a hard/symbolic link. However this check was guarded by a UNIX ifdef. The check itself is portable and the guard can be removed. Added a couple tests to check the behaviour of bkc=auto and bkc=no with a symbolic link. Reported in #4525
This commit is contained in:
@@ -2688,7 +2688,6 @@ buf_write (
|
||||
} else if ((bkc & BKC_AUTO)) { /* "auto" */
|
||||
int i;
|
||||
|
||||
# ifdef UNIX
|
||||
/*
|
||||
* Don't rename the file when:
|
||||
* - it's a hard link
|
||||
@@ -2699,9 +2698,7 @@ buf_write (
|
||||
|| !os_fileinfo_link((char *)fname, &file_info)
|
||||
|| !os_fileinfo_id_equal(&file_info, &file_info_old)) {
|
||||
backup_copy = TRUE;
|
||||
} else
|
||||
# endif
|
||||
{
|
||||
} else {
|
||||
/*
|
||||
* Check if we can create a file and set the owner/group to
|
||||
* the ones from the original file.
|
||||
|
Reference in New Issue
Block a user