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
This commit is contained in:
Shougo Matsushita 2014-09-18 08:00:28 +09:00
parent 53d15c2c25
commit 9829febebc
2 changed files with 8 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -231,7 +231,7 @@ static int included_patches[] = {
367,
//366,
365,
//364,
364,
//363,
362,
//361,