forked from aniani/vim
patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Problem: Crash when setting 'buftype' to "quickfix". Solution: Check that error list is not NULL. (closes #5613)
This commit is contained in:
@@ -4520,7 +4520,7 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last)
|
|||||||
*dirname = NUL;
|
*dirname = NUL;
|
||||||
|
|
||||||
// Add one line for each error
|
// Add one line for each error
|
||||||
if (old_last == NULL)
|
if (old_last == NULL || old_last->qf_next == NULL)
|
||||||
{
|
{
|
||||||
qfp = qfl->qf_start;
|
qfp = qfl->qf_start;
|
||||||
lnum = 0;
|
lnum = 0;
|
||||||
|
@@ -1628,6 +1628,13 @@ func Test_setqflist_invalid_nr()
|
|||||||
eval []->setqflist(' ', {'nr' : $XXX_DOES_NOT_EXIST})
|
eval []->setqflist(' ', {'nr' : $XXX_DOES_NOT_EXIST})
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_setqflist_user_sets_buftype()
|
||||||
|
call setqflist([{'text': 'foo'}, {'text': 'bar'}])
|
||||||
|
set buftype=quickfix
|
||||||
|
call setqflist([], 'a')
|
||||||
|
enew
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_quickfix_set_list_with_act()
|
func Test_quickfix_set_list_with_act()
|
||||||
call XquickfixSetListWithAct('c')
|
call XquickfixSetListWithAct('c')
|
||||||
call XquickfixSetListWithAct('l')
|
call XquickfixSetListWithAct('l')
|
||||||
|
@@ -742,6 +742,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 */
|
||||||
|
/**/
|
||||||
|
241,
|
||||||
/**/
|
/**/
|
||||||
240,
|
240,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user