aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-09-19 17:46:55 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-09-19 17:46:55 -0400
commit1fdfe3a484bf8f1c452023439ce2c9e61b856299 (patch)
treed12e8c06f357c3bf26fa0fb713eae8cb8ee02743 /src/nvim/ex_cmds.c
parent8eef40deafdb373c271edf2d8ac6be22b7451523 (diff)
parent9829febebcd9165c3913c7a6995b2e5ef4eacc1c (diff)
downloadrneovim-1fdfe3a484bf8f1c452023439ce2c9e61b856299.tar.gz
rneovim-1fdfe3a484bf8f1c452023439ce2c9e61b856299.tar.bz2
rneovim-1fdfe3a484bf8f1c452023439ce2c9e61b856299.zip
Merge pull request #1188 from Shougo/vim-patch-7.4.364
vim-patch:7.4.364
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index b72d1941ec..163d20f13a 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1648,11 +1648,13 @@ void write_viminfo(char_u *file, int forceit)
if (fp_in != NULL) {
fclose(fp_in);
- /*
- * In case of an error keep the original viminfo file.
- * Otherwise rename the newly written file.
- */
- if (viminfo_errcnt || vim_rename(tempname, fname) == -1) {
+ /* In case of an error keep the original viminfo file. Otherwise
+ * rename the newly written file. Give an error if that fails. */
+ if (viminfo_errcnt == 0 && vim_rename(tempname, fname) == -1) {
+ viminfo_errcnt++;
+ EMSG2(_("E886: Can't rename viminfo file to %s!"), fname);
+ }
+ if (viminfo_errcnt > 0) {
os_remove((char *)tempname);
}
}