Skip to content

Commit e9ebc9a

Browse files
committed
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)
1 parent 338dfda commit e9ebc9a

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15128,7 +15128,7 @@ f_undofile(typval_T *argvars UNUSED, typval_T *rettv)
1512815128
}
1512915129
else
1513015130
{
15131-
char_u *ffname = FullName_save(fname, FALSE);
15131+
char_u *ffname = FullName_save(fname, TRUE);
1513215132

1513315133
if (ffname != NULL)
1513415134
rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);

src/testdir/test_undo.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,5 +440,10 @@ funct Test_undofile()
440440
" Test undofile() with 'undodir' set to a non-existing directory.
441441
call assert_equal('', undofile('Xundofoo'))
442442

443+
if isdirectory('/tmp')
444+
set undodir=/tmp
445+
call assert_equal('/tmp/%tmp%file', undofile('///tmp/file'))
446+
endif
447+
443448
set undodir&
444449
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ static char *(features[]) =
767767

768768
static int included_patches[] =
769769
{ /* Add new patch number below this line */
770+
/**/
771+
1352,
770772
/**/
771773
1351,
772774
/**/

0 commit comments

Comments
 (0)