|
Karsten Hopp |
f14e28 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
f14e28 |
Subject: Patch 7.1.251
|
|
Karsten Hopp |
f14e28 |
Fcc: outbox
|
|
Karsten Hopp |
f14e28 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
f14e28 |
Mime-Version: 1.0
|
|
Karsten Hopp |
f14e28 |
Content-Type: text/plain; charset=ISO-8859-1
|
|
Karsten Hopp |
f14e28 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
f14e28 |
------------
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
Patch 7.1.251
|
|
Karsten Hopp |
f14e28 |
Problem: Using freed memory when spell checking enabled.
|
|
Karsten Hopp |
f14e28 |
Solution: Obtain the current line again after calling spell_move_to().
|
|
Karsten Hopp |
f14e28 |
(Dominique Pelle)
|
|
Karsten Hopp |
f14e28 |
Files: src/screen.c
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
*** ../vim-7.1.250/src/screen.c Sat Jan 19 15:55:51 2008
|
|
Karsten Hopp |
f14e28 |
--- src/screen.c Wed Feb 13 21:45:38 2008
|
|
Karsten Hopp |
f14e28 |
***************
|
|
Karsten Hopp |
f14e28 |
*** 2644,2650 ****
|
|
Karsten Hopp |
f14e28 |
#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
|
Karsten Hopp |
f14e28 |
|| defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
|
|
Karsten Hopp |
f14e28 |
# define LINE_ATTR
|
|
Karsten Hopp |
f14e28 |
! int line_attr = 0; /* atrribute for the whole line */
|
|
Karsten Hopp |
f14e28 |
#endif
|
|
Karsten Hopp |
f14e28 |
#ifdef FEAT_SEARCH_EXTRA
|
|
Karsten Hopp |
f14e28 |
matchitem_T *cur; /* points to the match list */
|
|
Karsten Hopp |
f14e28 |
--- 2644,2650 ----
|
|
Karsten Hopp |
f14e28 |
#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|
|
Karsten Hopp |
f14e28 |
|| defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
|
|
Karsten Hopp |
f14e28 |
# define LINE_ATTR
|
|
Karsten Hopp |
f14e28 |
! int line_attr = 0; /* attribute for the whole line */
|
|
Karsten Hopp |
f14e28 |
#endif
|
|
Karsten Hopp |
f14e28 |
#ifdef FEAT_SEARCH_EXTRA
|
|
Karsten Hopp |
f14e28 |
matchitem_T *cur; /* points to the match list */
|
|
Karsten Hopp |
f14e28 |
***************
|
|
Karsten Hopp |
f14e28 |
*** 3040,3057 ****
|
|
Karsten Hopp |
f14e28 |
if (has_spell)
|
|
Karsten Hopp |
f14e28 |
{
|
|
Karsten Hopp |
f14e28 |
int len;
|
|
Karsten Hopp |
f14e28 |
hlf_T spell_hlf = HLF_COUNT;
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
pos = wp->w_cursor;
|
|
Karsten Hopp |
f14e28 |
wp->w_cursor.lnum = lnum;
|
|
Karsten Hopp |
f14e28 |
! wp->w_cursor.col = (colnr_T)(ptr - line);
|
|
Karsten Hopp |
f14e28 |
len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf);
|
|
Karsten Hopp |
f14e28 |
if (len == 0 || (int)wp->w_cursor.col > ptr - line)
|
|
Karsten Hopp |
f14e28 |
{
|
|
Karsten Hopp |
f14e28 |
/* no bad word found at line start, don't check until end of a
|
|
Karsten Hopp |
f14e28 |
* word */
|
|
Karsten Hopp |
f14e28 |
spell_hlf = HLF_COUNT;
|
|
Karsten Hopp |
f14e28 |
! word_end = (int)(spell_to_word_end(ptr, wp->w_buffer) - line + 1);
|
|
Karsten Hopp |
f14e28 |
}
|
|
Karsten Hopp |
f14e28 |
else
|
|
Karsten Hopp |
f14e28 |
{
|
|
Karsten Hopp |
f14e28 |
--- 3040,3064 ----
|
|
Karsten Hopp |
f14e28 |
if (has_spell)
|
|
Karsten Hopp |
f14e28 |
{
|
|
Karsten Hopp |
f14e28 |
int len;
|
|
Karsten Hopp |
f14e28 |
+ colnr_T linecol = (colnr_T)(ptr - line);
|
|
Karsten Hopp |
f14e28 |
hlf_T spell_hlf = HLF_COUNT;
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
pos = wp->w_cursor;
|
|
Karsten Hopp |
f14e28 |
wp->w_cursor.lnum = lnum;
|
|
Karsten Hopp |
f14e28 |
! wp->w_cursor.col = linecol;
|
|
Karsten Hopp |
f14e28 |
len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf);
|
|
Karsten Hopp |
f14e28 |
+
|
|
Karsten Hopp |
f14e28 |
+ /* spell_move_to() may call ml_get() and make "line" invalid */
|
|
Karsten Hopp |
f14e28 |
+ line = ml_get_buf(wp->w_buffer, lnum, FALSE);
|
|
Karsten Hopp |
f14e28 |
+ ptr = line + linecol;
|
|
Karsten Hopp |
f14e28 |
+
|
|
Karsten Hopp |
f14e28 |
if (len == 0 || (int)wp->w_cursor.col > ptr - line)
|
|
Karsten Hopp |
f14e28 |
{
|
|
Karsten Hopp |
f14e28 |
/* no bad word found at line start, don't check until end of a
|
|
Karsten Hopp |
f14e28 |
* word */
|
|
Karsten Hopp |
f14e28 |
spell_hlf = HLF_COUNT;
|
|
Karsten Hopp |
f14e28 |
! word_end = (int)(spell_to_word_end(ptr, wp->w_buffer)
|
|
Karsten Hopp |
f14e28 |
! - line + 1);
|
|
Karsten Hopp |
f14e28 |
}
|
|
Karsten Hopp |
f14e28 |
else
|
|
Karsten Hopp |
f14e28 |
{
|
|
Karsten Hopp |
f14e28 |
*** ../vim-7.1.250/src/version.c Wed Feb 13 18:35:23 2008
|
|
Karsten Hopp |
f14e28 |
--- src/version.c Wed Feb 13 21:48:08 2008
|
|
Karsten Hopp |
f14e28 |
***************
|
|
Karsten Hopp |
f14e28 |
*** 668,669 ****
|
|
Karsten Hopp |
f14e28 |
--- 668,671 ----
|
|
Karsten Hopp |
f14e28 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
f14e28 |
+ /**/
|
|
Karsten Hopp |
f14e28 |
+ 251,
|
|
Karsten Hopp |
f14e28 |
/**/
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
--
|
|
Karsten Hopp |
f14e28 |
How To Keep A Healthy Level Of Insanity:
|
|
Karsten Hopp |
f14e28 |
6. In the memo field of all your checks, write "for sexual favors".
|
|
Karsten Hopp |
f14e28 |
|
|
Karsten Hopp |
f14e28 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
f14e28 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
f14e28 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
f14e28 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|