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 #714)
diff --git a/src/testdir/test_fnamemodify.vim b/src/testdir/test_fnamemodify.vim
index 902be40..2267e18 100644
--- a/src/testdir/test_fnamemodify.vim
+++ b/src/testdir/test_fnamemodify.vim
@@ -41,3 +41,9 @@
   call assert_equal("'abc\\\ndef'",  fnamemodify("abc\ndef", ':S'))
   set shell&
 endfunc
+
+func Test_expand()
+  new
+  call assert_equal("",  expand('%:S'))
+  quit
+endfunc