mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
vim-patch:7.4.251
Problem: Crash when BufAdd autocommand wipes out the buffer. Solution: Check for buffer to still be valid. Postpone freeing the buffer structure. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=29eb4c2a33ac701bfcd4d2e2bed7864eba876e0e
This commit is contained in:

committed by
Thiago de Arruda

parent
40970917dc
commit
cb0adf60de
@@ -2774,6 +2774,11 @@ do_ecmd (
|
||||
}
|
||||
buf = buflist_new(ffname, sfname, 0L,
|
||||
BLN_CURBUF | ((flags & ECMD_SET_HELP) ? 0 : BLN_LISTED));
|
||||
// Autocmds may change curwin and curbuf.
|
||||
if (oldwin != NULL) {
|
||||
oldwin = curwin;
|
||||
}
|
||||
old_curbuf = curbuf;
|
||||
}
|
||||
if (buf == NULL)
|
||||
goto theend;
|
||||
|
Reference in New Issue
Block a user