0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

updated for version 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.
This commit is contained in:
Bram Moolenaar 2014-07-09 21:18:04 +02:00
parent 455009122a
commit 3ed8b1332f
2 changed files with 10 additions and 5 deletions

View 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

View File

@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
364,
/**/
363,
/**/