Problem: Illegal memory access when using :copen and :cclose.
Solution: Avoid that curbuf is invalid. (suggestion by Justin M. Keyes)
Add a test.
endfunc
+function Test_helpgrep()
+ helpgrep quickfix
+ copen
+ " This wipes out the buffer, make sure that doesn't cause trouble.
+ cclose
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1137,
/**/
1136,
/**/
if (win_valid(win))
win->w_closing = FALSE;
#endif
+ /* 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