From: Bram Moolenaar Date: Sat, 28 Jul 2018 15:07:52 +0000 (+0200) Subject: patch 8.1.0219: expanding ## fails to escape backtick X-Git-Tag: v8.1.0219 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c8c681bfcd5138a0ec8ce018216dc2dc69a11a0;p=vim patch 8.1.0219: expanding ## fails to escape backtick Problem: Expanding ## fails to escape backtick. Solution: Escape a backtick in a file name. (closes #3257) --- diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 4c653ff5e..54fb6aba1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -10954,7 +10954,7 @@ arg_all(void) #ifndef BACKSLASH_IN_FILENAME || *p == '\\' #endif - ) + || *p == '`') { /* insert a backslash */ if (retval != NULL) diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index ab2fe7c82..651f1f8fa 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -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 diff --git a/src/version.c b/src/version.c index cf7fa29ce..4ea5c75bf 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 219, /**/ 218, /**/