]> granicus.if.org Git - vim/commitdiff
patch 8.1.0219: expanding ## fails to escape backtick v8.1.0219
authorBram Moolenaar <Bram@vim.org>
Sat, 28 Jul 2018 15:07:52 +0000 (17:07 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 28 Jul 2018 15:07:52 +0000 (17:07 +0200)
Problem:    Expanding ## fails to escape backtick.
Solution:   Escape a backtick in a file name. (closes #3257)

src/ex_docmd.c
src/testdir/test_edit.vim
src/version.c

index 4c653ff5e65d84573583ccca676769317f796668..54fb6aba1c3f8b5f66feff824fa730bce8ea2812 100644 (file)
@@ -10954,7 +10954,7 @@ arg_all(void)
 #ifndef BACKSLASH_IN_FILENAME
                            || *p == '\\'
 #endif
-                           )
+                           || *p == '`')
                    {
                        /* insert a backslash */
                        if (retval != NULL)
index ab2fe7c82444e584938b8c208d3dced18897d1ce..651f1f8fa424239eb81e13abe20e724f28f05fbf 100644 (file)
@@ -1375,6 +1375,14 @@ func Test_edit_complete_very_long_name()
   set swapfile&
 endfunc
 
+func Test_edit_backtick()
+  next a\`b c
+  call assert_equal('a`b', expand('%'))
+  next
+  call assert_equal('c', expand('%'))
+  call assert_equal('a\`b c', expand('##'))
+endfunc
+
 func Test_edit_quit()
   edit foo.txt
   split
index cf7fa29ce6454106340ba2cc1776dc9b15e73852..4ea5c75bf9fbe91f4b556daeae05f7f991dd67be 100644 (file)
@@ -798,6 +798,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    219,
 /**/
     218,
 /**/