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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user