mirror of
https://github.com/neovim/neovim.git
synced 2026-07-16 06:10:39 +00:00
vim-patch:8.2.5079: DirChanged autocommand may use freed memory
Problem: DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution: Free the memory later. (closes vim/vim#10555)
d8c9d32c89
Code change is N/A as Nvim gets the full current directory again before
applying the autocommand, so this just ports the tests.
This commit is contained in:
@@ -1981,6 +1981,13 @@ function Test_dirchanged_global()
|
||||
call assert_equal(expected, s:li)
|
||||
exe 'lcd ' .. fnameescape(s:dir_bar)
|
||||
call assert_equal(expected, s:li)
|
||||
|
||||
exe 'cd ' .. s:dir_foo
|
||||
exe 'cd ' .. s:dir_bar
|
||||
autocmd! test_dirchanged DirChanged global let g:result = expand("<afile>")
|
||||
cd -
|
||||
call assert_equal(s:dir_foo, g:result)
|
||||
|
||||
call s:After_test_dirchanged()
|
||||
endfunc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user