mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 7.4.2225
Problem: Crash when placing a sign in a deleted buffer. Solution: Check for missing buffer name. (Dominique Pelle). Add a test.
This commit is contained in:
@@ -7861,6 +7861,11 @@ ex_sign(exarg_T *eap)
|
|||||||
{ /* ... not currently in a window */
|
{ /* ... not currently in a window */
|
||||||
char_u *cmd;
|
char_u *cmd;
|
||||||
|
|
||||||
|
if (buf->b_fname == NULL)
|
||||||
|
{
|
||||||
|
EMSG(_("E934: Cannot jump to a buffer that does not have a name"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
cmd = alloc((unsigned)STRLEN(buf->b_fname) + 25);
|
cmd = alloc((unsigned)STRLEN(buf->b_fname) + 25);
|
||||||
if (cmd == NULL)
|
if (cmd == NULL)
|
||||||
return;
|
return;
|
||||||
|
@@ -181,3 +181,15 @@ func Test_sign_invalid_commands()
|
|||||||
call assert_fails('sign place 1 buffer=', 'E158:')
|
call assert_fails('sign place 1 buffer=', 'E158:')
|
||||||
call assert_fails('sign define Sign2 text=', 'E239:')
|
call assert_fails('sign define Sign2 text=', 'E239:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_sign_delete_buffer()
|
||||||
|
new
|
||||||
|
sign define Sign text=x
|
||||||
|
let bufnr = bufnr('%')
|
||||||
|
new
|
||||||
|
exe 'bd ' . bufnr
|
||||||
|
exe 'sign place 61 line=3 name=Sign buffer=' . bufnr
|
||||||
|
call assert_fails('sign jump 61 buffer=' . bufnr, 'E934:')
|
||||||
|
sign unplace 61
|
||||||
|
sign undefine Sign
|
||||||
|
endfunc
|
||||||
|
@@ -763,6 +763,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2225,
|
||||||
/**/
|
/**/
|
||||||
2224,
|
2224,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user