summaryrefslogtreecommitdiffstats
path: root/gvim/vim-7.2/7.2.332
blob: 7956d1ed84f30f1c5849e16076f9a614433f08ba (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
To: vim-dev@vim.org
Subject: Patch 7.2.332
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.332
Problem:    Crash when spell correcting triggers an autocommand that reloads
	    the buffer.
Solution:   Make a copy of the line to be modified. (Dominique Pelle)
Files:	    src/spell.c


*** ../vim-7.2.331/src/spell.c	2009-07-22 11:03:38.000000000 +0200
--- src/spell.c	2010-01-19 12:44:42.000000000 +0100
***************
*** 10306,10312 ****
      /* Figure out if the word should be capitalised. */
      need_cap = check_need_cap(curwin->w_cursor.lnum, curwin->w_cursor.col);
  
!     line = ml_get_curline();
  
      /* Get the list of suggestions.  Limit to 'lines' - 2 or the number in
       * 'spellsuggest', whatever is smaller. */
--- 10306,10315 ----
      /* Figure out if the word should be capitalised. */
      need_cap = check_need_cap(curwin->w_cursor.lnum, curwin->w_cursor.col);
  
!     /* Make a copy of current line since autocommands may free the line. */
!     line = vim_strsave(ml_get_curline());
!     if (line == NULL)
! 	goto skip;
  
      /* Get the list of suggestions.  Limit to 'lines' - 2 or the number in
       * 'spellsuggest', whatever is smaller. */
***************
*** 10470,10475 ****
--- 10473,10480 ----
  	curwin->w_cursor = prev_cursor;
  
      spell_find_cleanup(&sug);
+ skip:
+     vim_free(line);
  }
  
  /*
***************
*** 10931,10937 ****
  	    rescore_suggestions(su);
  
  	/*
! 	 * While going throught the soundfold tree "su_maxscore" is the score
  	 * for the soundfold word, limits the changes that are being tried,
  	 * and "su_sfmaxscore" the rescored score, which is set by
  	 * cleanup_suggestions().
--- 10936,10942 ----
  	    rescore_suggestions(su);
  
  	/*
! 	 * While going through the soundfold tree "su_maxscore" is the score
  	 * for the soundfold word, limits the changes that are being tried,
  	 * and "su_sfmaxscore" the rescored score, which is set by
  	 * cleanup_suggestions().
***************
*** 11415,11421 ****
      char_u	tword[MAXWLEN];	    /* good word collected so far */
      trystate_T	stack[MAXWLEN];
      char_u	preword[MAXWLEN * 3]; /* word found with proper case;
! 				       * concatanation of prefix compound
  				       * words and split word.  NUL terminated
  				       * when going deeper but not when coming
  				       * back. */
--- 11420,11426 ----
      char_u	tword[MAXWLEN];	    /* good word collected so far */
      trystate_T	stack[MAXWLEN];
      char_u	preword[MAXWLEN * 3]; /* word found with proper case;
! 				       * concatenation of prefix compound
  				       * words and split word.  NUL terminated
  				       * when going deeper but not when coming
  				       * back. */
*** ../vim-7.2.331/src/version.c	2010-01-19 12:46:51.000000000 +0100
--- src/version.c	2010-01-19 13:05:32.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     332,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
117. You are more comfortable typing in html.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///