To: vim_dev@googlegroups.com Subject: Patch 9.0.0322 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0322 Problem: Crash when no errors and 'quickfixtextfunc' is set. Solution: Do not handle errors if there aren't any. Files: src/quickfix.c, src/testdir/test_quickfix.vim *** ../vim-9.0.0321/src/quickfix.c 2022-08-27 20:59:51.849354123 +0100 --- src/quickfix.c 2022-08-29 20:42:15.096315367 +0100 *************** *** 4761,4767 **** } // Check if there is anything to display ! if (qfl != NULL) { char_u dirname[MAXPATHL]; int invalid_val = FALSE; --- 4761,4767 ---- } // Check if there is anything to display ! if (qfl != NULL && qfl->qf_start != NULL) { char_u dirname[MAXPATHL]; int invalid_val = FALSE; *** ../vim-9.0.0321/src/testdir/test_quickfix.vim 2022-08-27 20:59:51.849354123 +0100 --- src/testdir/test_quickfix.vim 2022-08-29 20:43:15.960410624 +0100 *************** *** 4107,4112 **** --- 4107,4128 ---- endif 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() call Xgetlist_empty_tests('c') call Xgetlist_empty_tests('l') *** ../vim-9.0.0321/src/version.c 2022-08-29 18:16:11.578636822 +0100 --- src/version.c 2022-08-29 20:26:26.552189456 +0100 *************** *** 709,710 **** --- 709,712 ---- { /* Add new patch number below this line */ + /**/ + 322, /**/ -- How come wrong numbers are never busy? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///