aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2014-09-18 08:00:28 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2014-09-19 19:48:39 +0900
commit9829febebcd9165c3913c7a6995b2e5ef4eacc1c (patch)
tree298e994e2edfc15ac69356ac848ee0c2e4843423
parent53d15c2c25199f8e44e9a8a74898f06a85e7c83b (diff)
downloadrneovim-9829febebcd9165c3913c7a6995b2e5ef4eacc1c.tar.gz
rneovim-9829febebcd9165c3913c7a6995b2e5ef4eacc1c.tar.bz2
rneovim-9829febebcd9165c3913c7a6995b2e5ef4eacc1c.zip
vim-patch:7.4.364
Problem: When the viminfo file can't be renamed there is no error message. (Vladimir Berezhnoy) Solution: Check for the rename to fail. https://code.google.com/p/vim/source/detail?r=v7-4-364
-rw-r--r--src/nvim/ex_cmds.c12
-rw-r--r--src/nvim/version.c2
2 files changed, 8 insertions, 6 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);
}
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e80c1f81a1..eac494389b 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -231,7 +231,7 @@ static int included_patches[] = {
367,
//366,
365,
- //364,
+ 364,
//363,
362,
//361,