]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.364 v7.4.364
authorBram Moolenaar <Bram@vim.org>
Wed, 9 Jul 2014 19:18:04 +0000 (21:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Jul 2014 19:18:04 +0000 (21:18 +0200)
Problem:    When the viminfo file can't be renamed there is no error message.
            (Vladimir Berezhnoy)
Solution:   Check for the rename to fail.

src/ex_cmds.c
src/version.c

index 2e5917f4a28b804e8e8dfc89d26080a1f6146935..62621bfa57cc8ece7ed0ddaf24660847030569a2 100644 (file)
@@ -2004,11 +2004,14 @@ write_viminfo(file, forceit)
     {
        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)
            mch_remove(tempname);
 
 #ifdef WIN3264
index 150a950e7e6b877c2f5318f6ec8168533d74733d..0bfd039de653cfd8cf732c7f40afb2a2f216be24 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    364,
 /**/
     363,
 /**/