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

updated for version 7.3.512

Problem:    undofile() returns a useless name when passed an empty string.
Solution:   Return an empty string. (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2012-04-30 17:35:48 +02:00
parent 7da9c37a17
commit b41d9689f1
2 changed files with 16 additions and 4 deletions

View File

@@ -18259,11 +18259,21 @@ f_undofile(argvars, rettv)
rettv->v_type = VAR_STRING;
#ifdef FEAT_PERSISTENT_UNDO
{
char_u *ffname = FullName_save(get_tv_string(&argvars[0]), FALSE);
char_u *fname = get_tv_string(&argvars[0]);
if (ffname != NULL)
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
vim_free(ffname);
if (*fname == NUL)
{
/* If there is no file name there will be no undo file. */
rettv->vval.v_string = NULL;
}
else
{
char_u *ffname = FullName_save(fname, FALSE);
if (ffname != NULL)
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
vim_free(ffname);
}
}
#else
rettv->vval.v_string = NULL;