summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0242
blob: 2f8d1cc7c6cf676c3a2fb9a4a4387c73258b2f46 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0242
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.0242
Problem:    Insert mode completion may use an invalid buffer pointer.
Solution:   Check for ins_buf to be valid. (closes #3290)
Files:	    src/edit.c


*** ../vim-8.1.0241/src/edit.c	2018-08-01 19:05:59.282223206 +0200
--- src/edit.c	2018-08-07 14:53:05.865949346 +0200
***************
*** 4419,4428 ****
  					    ? (char_u *)"." : curbuf->b_p_cpt;
  	last_match_pos = first_match_pos = *ini;
      }
  
      compl_old_match = compl_curr_match;	/* remember the last current match */
      pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos;
!     /* For ^N/^P loop over all the flags/windows/buffers in 'complete' */
      for (;;)
      {
  	found_new_match = FAIL;
--- 4419,4433 ----
  					    ? (char_u *)"." : curbuf->b_p_cpt;
  	last_match_pos = first_match_pos = *ini;
      }
+     else if (ins_buf != curbuf && !buf_valid(ins_buf))
+ 	ins_buf = curbuf;  // In case the buffer was wiped out.
  
      compl_old_match = compl_curr_match;	/* remember the last current match */
      pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos;
! 
!     /*
!      * For ^N/^P loop over all the flags/windows/buffers in 'complete'.
!      */
      for (;;)
      {
  	found_new_match = FAIL;
*** ../vim-8.1.0241/src/version.c	2018-08-07 13:14:05.644508497 +0200
--- src/version.c	2018-08-07 14:54:09.961578224 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     242,
  /**/

-- 
Did you ever stop to think...  and forget to start again?
                                  -- Steven Wright

 /// 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    ///