diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-06 09:00:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-06 09:00:24 -0400 |
commit | 71107e12c7b68d8faf1bcc1a5794a55b21e146f3 (patch) | |
tree | 57623fc268dbf5d2a919f04aa3d66c78bff78cb4 /src/nvim/fileio.c | |
parent | 8a93d1028f38c77d7ad8b4ad0a93dc11a5cbe85d (diff) | |
parent | 296711cfad7bb8d80f2e2c363b3708764156444f (diff) | |
download | rneovim-71107e12c7b68d8faf1bcc1a5794a55b21e146f3.tar.gz rneovim-71107e12c7b68d8faf1bcc1a5794a55b21e146f3.tar.bz2 rneovim-71107e12c7b68d8faf1bcc1a5794a55b21e146f3.zip |
Merge pull request #14499 from janlazo/vim-8.2.2819
vim-patch:8.0.1309,8.2.{1166,2819,2820,2825,2827,2828,2829,2832,2833}
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 792ef81665..29c29a2884 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -4560,11 +4560,12 @@ int vim_rename(const char_u *from, const char_u *to) if (!os_path_exists(tempname)) { if (os_rename(from, tempname) == OK) { - if (os_rename(tempname, to) == OK) + if (os_rename(tempname, to) == OK) { return 0; - /* Strange, the second step failed. Try moving the - * file back and return failure. */ - os_rename(tempname, from); + } + // Strange, the second step failed. Try moving the + // file back and return failure. + (void)os_rename(tempname, from); return -1; } /* If it fails for one temp name it will most likely fail |