mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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)
This commit is contained in:
@@ -26439,8 +26439,10 @@ repeat:
|
||||
{
|
||||
/* vim_strsave_shellescape() needs a NUL terminated string. */
|
||||
c = (*fnamep)[*fnamelen];
|
||||
if (c != NUL)
|
||||
(*fnamep)[*fnamelen] = NUL;
|
||||
p = vim_strsave_shellescape(*fnamep, FALSE, FALSE);
|
||||
if (c != NUL)
|
||||
(*fnamep)[*fnamelen] = c;
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
|
@@ -41,3 +41,9 @@ func Test_fnamemodify()
|
||||
call assert_equal("'abc\\\ndef'", fnamemodify("abc\ndef", ':S'))
|
||||
set shell&
|
||||
endfunc
|
||||
|
||||
func Test_expand()
|
||||
new
|
||||
call assert_equal("", expand('%:S'))
|
||||
quit
|
||||
endfunc
|
||||
|
@@ -748,6 +748,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1654,
|
||||
/**/
|
||||
1653,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user