diff options
author | James McCoy <jamessan@jamessan.com> | 2017-08-09 16:40:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-09 16:40:12 -0400 |
commit | dac216cf8ed3e26beaa0fa252a5e8a78651dbd5b (patch) | |
tree | 08e504e04bcaa86ffec11979f407c36ab8c0037f | |
parent | e13b4a21cac9d173885249034fe20fb209b157df (diff) | |
parent | 9506ee037083ff047a3601b3d97acf91521a58fb (diff) | |
download | rneovim-dac216cf8ed3e26beaa0fa252a5e8a78651dbd5b.tar.gz rneovim-dac216cf8ed3e26beaa0fa252a5e8a78651dbd5b.tar.bz2 rneovim-dac216cf8ed3e26beaa0fa252a5e8a78651dbd5b.zip |
Merge pull request #7135 from justinmk/buf_write
buf_write(): wrong argument to os_fileinfo_hardlinks()
-rw-r--r-- | src/nvim/fileio.c | 6 | ||||
-rw-r--r-- | src/nvim/os/fs.c | 1 |
2 files changed, 5 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; diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 14dacd97c4..9e3025cf89 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -131,6 +131,7 @@ bool os_isdir(const char_u *name) /// NODE_WRITABLE: writable device, socket, fifo, etc. /// NODE_OTHER: non-writable things int os_nodetype(const char *name) + FUNC_ATTR_NONNULL_ALL { #ifdef WIN32 // Edge case from Vim os_win32.c: |