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 vim/vim#5613)
99234f29aa
This commit is contained in:
Jan Edmund Lazo 2020-02-10 19:55:59 -05:00
parent bde4f47eb2
commit 5e38516a46
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 8 additions and 1 deletions

View File

@ -3845,7 +3845,7 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last)
*dirname = NUL;
// Add one line for each error
if (old_last == NULL) {
if (old_last == NULL || old_last->qf_next == NULL) {
qfp = qfl->qf_start;
lnum = 0;
} else {

View File

@ -1510,6 +1510,13 @@ func Test_setqflist_invalid_nr()
call setqflist([], ' ', {'nr' : $XXX_DOES_NOT_EXIST})
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()
call XquickfixSetListWithAct('c')
call XquickfixSetListWithAct('l')