]> granicus.if.org Git - vim/commitdiff
patch 8.1.1352: undofile() reports wrong name v8.1.1352
authorBram Moolenaar <Bram@vim.org>
Sun, 19 May 2019 13:27:14 +0000 (15:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 May 2019 13:27:14 +0000 (15:27 +0200)
Problem:    Undofile() reports wrong name. (Francisco Giordano)
Solution:   Clean up the name before changing path separators. (closes #4392,
            closes #4394)

src/evalfunc.c
src/testdir/test_undo.vim
src/version.c

index b5a6d685c6cec7a6c8e5e4131f42c999a6578255..4c02e159b969166f1a2ad05b9b2c9e5a9b469f3a 100644 (file)
@@ -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);
index 7c93e2315340629a1c357e91d949153b52e5bbd3..ba1c861f8b9c6624c3378711a9cd1374ae0fa71b 100644 (file)
@@ -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
index 8bf07e3e99a7c811135a9ec0ce8cd204d4143b22..f349d7b733ead6a7db9d516d35de273a2b9b677e 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1352,
 /**/
     1351,
 /**/