1
0
forked from aniani/vim

patch 8.2.4453: :helpgrep may free an option that was not allocated

Problem:    :helpgrep may free an option that was not allocated. (Yegappan
            Lakshmanan)
Solution:   Check if the value was allocated.
This commit is contained in:
Bram Moolenaar
2022-02-23 12:06:00 +00:00
parent 2dada73a4e
commit 4791fcd825
5 changed files with 42 additions and 1 deletions

View File

@@ -745,6 +745,33 @@ def Test_helpgrep_vim9_restore_cpo()
helpclose
enddef
func Test_helpgrep_restore_cpo_aucmd()
let save_cpo = &cpo
augroup QF_Test
au!
autocmd BufNew * set cpo=acd
augroup END
helpgrep quickfix
call assert_equal('acd', &cpo)
%bw!
set cpo&vim
augroup QF_Test
au!
autocmd BufReadPost * set cpo=
augroup END
helpgrep buffer
call assert_equal('', &cpo)
augroup QF_Test
au!
augroup END
%bw!
let &cpo = save_cpo
endfunc
def Test_vim9_cexpr()
var text = 'somefile:95:error'
cexpr text