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.
Files: src/ex_cmds.c, src/testdir/test_signs.vim
*** ../vim-7.4.2224/src/ex_cmds.c 2016-08-16 21:04:37.827952367 +0200
--- src/ex_cmds.c 2016-08-17 22:22:26.106231680 +0200
***************
*** 7861,7866 ****
--- 7861,7871 ----
{ /* ... not currently in a window */
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);
if (cmd == NULL)
return;
*** ../vim-7.4.2224/src/testdir/test_signs.vim 2016-08-10 21:36:19.315004293
+0200
--- src/testdir/test_signs.vim 2016-08-17 22:24:41.224984587 +0200
***************
*** 181,183 ****
--- 181,195 ----
call assert_fails('sign place 1 buffer=', 'E158:')
call assert_fails('sign define Sign2 text=', 'E239:')
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
*** ../vim-7.4.2224/src/version.c 2016-08-17 21:51:52.259045616 +0200
--- src/version.c 2016-08-17 22:11:32.512257441 +0200
***************
*** 765,766 ****
--- 765,768 ----
{ /* Add new patch number below this line */
+ /**/
+ 2225,
/**/
--
`The Guide says there is an art to flying,' said Ford, `or at least a
knack. The knack lies in learning how to throw yourself at the ground
and miss.' He smiled weakly.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.