# HG changeset patch # User Bram Moolenaar # Date 1558272608 -7200 # Node ID 46322a4e60287ed8c09df527f6f08670e41acba5 # Parent ca80f8eea726dc02ff00ec4b2d1b41312271f3bb patch 8.1.1352: undofile() reports wrong name commit https://github.com/vim/vim/commit/e9ebc9a91cac357fd4888f4b71fdff7d97b41160 Author: Bram Moolenaar Date: Sun May 19 15:27:14 2019 +0200 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 https://github.com/vim/vim/issues/4392, closes #4394) diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -15128,7 +15128,7 @@ f_undofile(typval_T *argvars UNUSED, typ } 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); diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim --- a/src/testdir/test_undo.vim +++ b/src/testdir/test_undo.vim @@ -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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1352, +/**/ 1351, /**/ 1350,