mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -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:
12
src/eval.c
12
src/eval.c
@@ -18259,12 +18259,22 @@ f_undofile(argvars, rettv)
|
|||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
#ifdef FEAT_PERSISTENT_UNDO
|
#ifdef FEAT_PERSISTENT_UNDO
|
||||||
{
|
{
|
||||||
char_u *ffname = FullName_save(get_tv_string(&argvars[0]), FALSE);
|
char_u *fname = get_tv_string(&argvars[0]);
|
||||||
|
|
||||||
|
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)
|
if (ffname != NULL)
|
||||||
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
|
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
|
||||||
vim_free(ffname);
|
vim_free(ffname);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
rettv->vval.v_string = NULL;
|
rettv->vval.v_string = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -714,6 +714,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
512,
|
||||||
/**/
|
/**/
|
||||||
511,
|
511,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user