From 7558f42f7d9900d37a1915ce78f1102ee251d420 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 28 Mar 2016 09:47:46 -0400 Subject: vim-patch:7.4.1654 Problem: Crash when using expand('%:S') in a buffer without a name. Solution: Don't set a NUL. (James McCoy, closes vim/vim#714) https://github.com/vim/vim/commit/52c6eaffd43a8c8865f8d6ed7cde0a8b137479e2 --- test/functional/legacy/fnamemodify_spec.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index a439e91b6f..2a32aea127 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -54,6 +54,12 @@ describe('filename modifiers', function() set shell=tcsh call assert_equal("'abc\\\ndef'", fnamemodify("abc\ndef", ':S')) endfunc + + func Test_expand() + new + call assert_equal("", expand('%:S')) + quit + endfunc ]=]) end) @@ -61,4 +67,9 @@ describe('filename modifiers', function() call('Test_fnamemodify') expected_empty() end) + + it('works for :S in an unnamed buffer', function() + call('Test_expand') + expected_empty() + end) end) -- cgit