summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0060
blob: b1af72ef4d6313bb7eff284e0cdbeaeeb0af8c64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0060
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0060
Problem:    Crash when autocommands delete the current buffer. (Dominique
            Pelle)
Solution:   Check that autocommands don't change the buffer.
Files:	    src/quickfix.c, src/testdir/test_quickfix.vim


*** ../vim-8.1.0059/src/quickfix.c	2018-05-21 16:56:33.683217200 +0200
--- src/quickfix.c	2018-06-16 21:57:15.946537874 +0200
***************
*** 6272,6279 ****
--- 6272,6287 ----
  	    if (res >= 0)
  		qf_list_changed(qi, qi->qf_curlist);
  	    if (au_name != NULL)
+ 	    {
+ 		buf_T *curbuf_old = curbuf;
+ 
  		apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
  						curbuf->b_fname, TRUE, curbuf);
+ 		if (curbuf != curbuf_old)
+ 		    // Autocommands changed buffer, don't jump now, "qi" may
+ 		    // be invalid.
+ 		    res = 0;
+ 	    }
  	    if (res > 0 && (eap->cmdidx == CMD_cbuffer ||
  						eap->cmdidx == CMD_lbuffer))
  		qf_jump(qi, 0, 0, eap->forceit);  /* display first error */
*** ../vim-8.1.0059/src/testdir/test_quickfix.vim	2018-05-15 21:53:11.000000000 +0200
--- src/testdir/test_quickfix.vim	2018-06-16 21:49:48.980572266 +0200
***************
*** 3350,3352 ****
--- 3350,3364 ----
    call assert_equal('Errors', w:quickfix_title)
    cclose
  endfunc
+ 
+ func Test_lbuffer_with_bwipe()
+   new
+   new
+   augroup nasty
+     au * * bwipe
+   augroup END
+   lbuffer
+   augroup nasty
+     au!
+   augroup END
+ endfunc
*** ../vim-8.1.0059/src/version.c	2018-06-16 17:25:17.997346631 +0200
--- src/version.c	2018-06-16 21:58:12.078265886 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     60,
  /**/

-- 
Keyboard not found.  Think ENTER to continue.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///