mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
vim-patch:9.0.0322: crash when no errors and 'quickfixtextfunc' is set (#21269)
Problem: Crash when no errors and 'quickfixtextfunc' is set.
Solution: Do not handle errors if there aren't any.
4f1b083be4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -4076,7 +4076,7 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int q
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is anything to display
|
// Check if there is anything to display
|
||||||
if (qfl != NULL) {
|
if (qfl != NULL && qfl->qf_start != NULL) {
|
||||||
char dirname[MAXPATHL];
|
char dirname[MAXPATHL];
|
||||||
|
|
||||||
*dirname = NUL;
|
*dirname = NUL;
|
||||||
|
@@ -3932,6 +3932,22 @@ func Xgetlist_empty_tests(cchar)
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_empty_list_quickfixtextfunc()
|
||||||
|
" This was crashing. Can only reproduce by running it in a separate Vim
|
||||||
|
" instance.
|
||||||
|
let lines =<< trim END
|
||||||
|
func s:Func(o)
|
||||||
|
cgetexpr '0'
|
||||||
|
endfunc
|
||||||
|
cope
|
||||||
|
let &quickfixtextfunc = 's:Func'
|
||||||
|
cgetfile [ex
|
||||||
|
END
|
||||||
|
call writefile(lines, 'Xquickfixtextfunc')
|
||||||
|
call RunVim([], [], '-e -s -S Xquickfixtextfunc -c qa')
|
||||||
|
call delete('Xquickfixtextfunc')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_getqflist()
|
func Test_getqflist()
|
||||||
call Xgetlist_empty_tests('c')
|
call Xgetlist_empty_tests('c')
|
||||||
call Xgetlist_empty_tests('l')
|
call Xgetlist_empty_tests('l')
|
||||||
|
Reference in New Issue
Block a user