summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-19 15:27:14 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-19 15:27:14 +0200
commite9ebc9a91cac357fd4888f4b71fdff7d97b41160 (patch)
treec0625571a7e082e117c2be5452c3529c1f317891
parent338dfdad3844ebb1ce1d56c421d1f698c086eb0c (diff)
downloadvim-git-e9ebc9a91cac357fd4888f4b71fdff7d97b41160.tar.gz
patch 8.1.1352: undofile() reports wrong namev8.1.1352
Problem: Undofile() reports wrong name. (Francisco Giordano) Solution: Clean up the name before changing path separators. (closes #4392, closes #4394)
-rw-r--r--src/evalfunc.c2
-rw-r--r--src/testdir/test_undo.vim5
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index b5a6d685c..4c02e159b 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -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);
diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim
index 7c93e2315..ba1c861f8 100644
--- 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
index 8bf07e3e9..f349d7b73 100644
--- 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,