]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.765 v7.3.765
authorBram Moolenaar <Bram@vim.org>
Thu, 17 Jan 2013 13:00:11 +0000 (14:00 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 17 Jan 2013 13:00:11 +0000 (14:00 +0100)
Problem:    Segfault when doing "cclose" on BufUnload in a python function.
            (Sean Reifschneider)
Solution:   Skip window with NULL buffer. (Christian Brabandt)

src/main.c
src/version.c
src/window.c

index 66726d2790bfd2b843d45997e2f75d7414e5fad5..6581ba93975470465483b952c14f6a7c1bcb4b77 100644 (file)
@@ -1376,6 +1376,9 @@ getout(exitval)
            for (wp = (tp == curtab)
                    ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next)
            {
+               if (wp->w_buffer == NULL)
+                   /* Autocmd must have close the buffer already, skip. */
+                   continue;
                buf = wp->w_buffer;
                if (buf->b_changedtick != -1)
                {
index c9bf6ded7ca19b46625d7ec107dbe879d383b29e..375b07d491917b7cae460f4969510d5fdbca1fc9 100644 (file)
@@ -725,6 +725,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    765,
 /**/
     764,
 /**/
index e37450d98e15f1241d39da8480da6885ec393cb3..b5d4afd2b4702ca6bfb0573d4c0ff8dc652412dd 100644 (file)
@@ -2276,9 +2276,15 @@ win_close(win, free_buf)
 #endif
     }
 
+    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. */
+       getout(0);
+
     /* Autocommands may have closed the window already, or closed the only
      * other window or moved to another tab page. */
-    if (!win_valid(win) || last_window() || curtab != prev_curtab
+    else if (!win_valid(win) || last_window() || curtab != prev_curtab
            || close_last_window_tabpage(win, free_buf, prev_curtab))
        return;
 
@@ -6282,7 +6288,8 @@ only_one_window()
        return FALSE;
 
     for (wp = firstwin; wp != NULL; wp = wp->w_next)
-       if ((!((wp->w_buffer->b_help && !curbuf->b_help)
+       if (wp->w_buffer != NULL
+               && (!((wp->w_buffer->b_help && !curbuf->b_help)
 # ifdef FEAT_QUICKFIX
                    || wp->w_p_pvw
 # endif