mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 14:28:18 +00:00
vim-patch:7.4.1137
Problem: Illegal memory access when using :copen and :cclose.
Solution: Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
Add a test.
62ef797496
This commit is contained in:
@@ -1913,9 +1913,16 @@ int win_close(win_T *win, int free_buf)
|
||||
*/
|
||||
if (win->w_buffer != NULL) {
|
||||
win->w_closing = true;
|
||||
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE);
|
||||
if (win_valid(win))
|
||||
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, true);
|
||||
if (win_valid(win)) {
|
||||
win->w_closing = false;
|
||||
}
|
||||
|
||||
// Make sure curbuf is valid. It can become invalid if 'bufhidden' is
|
||||
// "wipe".
|
||||
if (!buf_valid(curbuf)) {
|
||||
curbuf = firstbuf;
|
||||
}
|
||||
}
|
||||
|
||||
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
|
||||
|
Reference in New Issue
Block a user