mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.1352: undofile() reports wrong name
Problem: Undofile() reports wrong name. (Francisco Giordano) Solution: Clean up the name before changing path separators. (closes #4392, closes #4394)
This commit is contained in:
parent
338dfdad38
commit
e9ebc9a91c
@ -15128,7 +15128,7 @@ f_undofile(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
}
|
||||
else
|
||||
{
|
||||
char_u *ffname = FullName_save(fname, FALSE);
|
||||
char_u *ffname = FullName_save(fname, TRUE);
|
||||
|
||||
if (ffname != NULL)
|
||||
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
|
||||
|
@ -440,5 +440,10 @@ funct Test_undofile()
|
||||
" Test undofile() with 'undodir' set to a non-existing directory.
|
||||
call assert_equal('', undofile('Xundofoo'))
|
||||
|
||||
if isdirectory('/tmp')
|
||||
set undodir=/tmp
|
||||
call assert_equal('/tmp/%tmp%file', undofile('///tmp/file'))
|
||||
endif
|
||||
|
||||
set undodir&
|
||||
endfunc
|
||||
|
@ -767,6 +767,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1352,
|
||||
/**/
|
||||
1351,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user