mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0614: SpellFileMissing autocmd may delete buffer
Problem: SpellFileMissing autocmd may delete buffer. Solution: Disallow deleting the current buffer to avoid using freed memory.
This commit is contained in:
@@ -468,7 +468,12 @@ can_unload_buffer(buf_T *buf)
|
||||
}
|
||||
}
|
||||
if (!can_unload)
|
||||
semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str), buf->b_fname);
|
||||
{
|
||||
char_u *fname = buf->b_fname != NULL ? buf->b_fname : buf->b_ffname;
|
||||
|
||||
semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str),
|
||||
fname != NULL ? fname : (char_u *)"[No Name]");
|
||||
}
|
||||
return can_unload;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user