updated for version 7.4a.042
Problem: Crash when BufUnload autocommands close all buffers. (Andrew
Pimlott)
Solution: Set curwin->w_buffer to curbuf to avoid NULL.
diff --git a/src/window.c b/src/window.c
index 28bb125..d1c1e93 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2291,8 +2291,13 @@
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
&& (last_window() || curtab != prev_curtab
|| close_last_window_tabpage(win, free_buf, prev_curtab)))
- /* Autocommands have close all windows, quit now. */
+ {
+ /* Autocommands have close all windows, quit now. Restore
+ * curwin->w_buffer, otherwise writing viminfo may fail. */
+ if (curwin->w_buffer == NULL)
+ curwin->w_buffer = curbuf;
getout(0);
+ }
/* Autocommands may have closed the window already, or closed the only
* other window or moved to another tab page. */