diff options
author | ckelsel <ckelsel@hotmail.com> | 2017-08-10 08:31:50 +0800 |
---|---|---|
committer | ckelsel <ckelsel@hotmail.com> | 2017-08-10 08:31:50 +0800 |
commit | 9a5d309b5743d70832b4daedcea934af5e6cc127 (patch) | |
tree | b35a1bec0e65da69b183bb074f2dab9354c18534 /src/nvim/fileio.c | |
parent | 8b4dc955b7384180c1ae0eab6050bbf4e17c7673 (diff) | |
parent | 085102fadf1c1371e863c0e9af8240038ce641e2 (diff) | |
download | rneovim-9a5d309b5743d70832b4daedcea934af5e6cc127.tar.gz rneovim-9a5d309b5743d70832b4daedcea934af5e6cc127.tar.bz2 rneovim-9a5d309b5743d70832b4daedcea934af5e6cc127.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index a0536d456d..643020df5e 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3162,8 +3162,8 @@ nobackup: #ifdef UNIX FileInfo file_info; - /* Don't delete the file when it's a hard or symbolic link. */ - if ((!newfile && os_fileinfo_hardlinks(&file_info) > 1) + // Don't delete the file when it's a hard or symbolic link. + if ((!newfile && os_fileinfo_hardlinks(&file_info_old) > 1) || (os_fileinfo_link((char *)fname, &file_info) && !os_fileinfo_id_equal(&file_info, &file_info_old))) { SET_ERRMSG(_("E166: Can't open linked file for writing")); @@ -4547,6 +4547,7 @@ int put_time(FILE *fd, time_t time_) /// /// @return -1 for failure, 0 for success int vim_rename(const char_u *from, const char_u *to) + FUNC_ATTR_NONNULL_ALL { int fd_in; int fd_out; @@ -4822,6 +4823,7 @@ buf_check_timestamp ( buf_T *buf, int focus /* called for GUI focus event */ ) + FUNC_ATTR_NONNULL_ALL { int retval = 0; char_u *path; |