4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Memory leak when adding a highlight group with unprintable
12 characters, resulting in E669.
13 Solution: Free the memory. And fix a few typos. (Dominique Pelle)
17 *** ../vim-7.2.316/src/syntax.c 2009-05-17 13:30:58.000000000 +0200
18 --- src/syntax.c 2009-12-16 18:09:05.000000000 +0100
21 static int current_attr = 0; /* attr of current syntax word */
23 static int current_id = 0; /* ID of current char for syn_get_id() */
24 ! static int current_trans_id = 0; /* idem, transparancy removed */
27 typedef struct syn_cluster_S
29 static int current_attr = 0; /* attr of current syntax word */
31 static int current_id = 0; /* ID of current char for syn_get_id() */
32 ! static int current_trans_id = 0; /* idem, transparency removed */
35 typedef struct syn_cluster_S
38 int si_idx; /* index of syntax pattern or
40 int si_id; /* highlight group ID for keywords */
41 ! int si_trans_id; /* idem, transparancy removed */
42 int si_m_lnum; /* lnum of the match */
43 int si_m_startcol; /* starting column of the match */
44 lpos_T si_m_endpos; /* just after end posn of the match */
46 int si_idx; /* index of syntax pattern or
48 int si_id; /* highlight group ID for keywords */
49 ! int si_trans_id; /* idem, transparency removed */
50 int si_m_lnum; /* lnum of the match */
51 int si_m_startcol; /* starting column of the match */
52 lpos_T si_m_endpos; /* just after end posn of the match */
55 dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
58 ! * Go throught the list to find the "tick" for the oldest entry that can
59 * be removed. Set "above" when the "tick" for the oldest entry is above
60 * "b_sst_lasttick" (the display tick wraps around).
63 dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
66 ! * Go through the list to find the "tick" for the oldest entry that can
67 * be removed. Set "above" when the "tick" for the oldest entry is above
68 * "b_sst_lasttick" (the display tick wraps around).
72 ? (syn_buf->b_spell_cluster_id == 0)
73 : (syn_buf->b_syn_spell == SYNSPL_TOP);
75 ! /* nextgroup ends at end of line, unless "skipnl" or "skipemtpy" present */
76 if (current_next_list != NULL
77 && syn_getcurline()[current_col + 1] == NUL
78 && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
80 ? (syn_buf->b_spell_cluster_id == 0)
81 : (syn_buf->b_syn_spell == SYNSPL_TOP);
83 ! /* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */
84 if (current_next_list != NULL
85 && syn_getcurline()[current_col + 1] == NUL
86 && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
92 ! int trans; /* remove transparancy */
93 int *spellp; /* return: can do spell checking */
94 int keep_state; /* keep state of char at "col" */
100 ! int trans; /* remove transparency */
101 int *spellp; /* return: can do spell checking */
102 int keep_state; /* keep state of char at "col" */
106 #if defined(FEAT_GUI) || defined(PROTO)
108 * Set the normal foreground and background colors according to the "Normal"
109 ! * highlighighting group. For X11 also set "Menu", "Scrollbar", and
114 #if defined(FEAT_GUI) || defined(PROTO)
116 * Set the normal foreground and background colors according to the "Normal"
117 ! * highlighting group. For X11 also set "Menu", "Scrollbar", and
124 if (!vim_isprintc(*p))
126 EMSG(_("E669: Unprintable character in group name"));
130 else if (!ASCII_ISALNUM(*p) && *p != '_')
131 *** ../vim-7.2.316/src/version.c 2009-12-16 17:14:08.000000000 +0100
132 --- src/version.c 2009-12-16 18:09:14.000000000 +0100
136 { /* Add new patch number below this line */
142 hundred-and-one symptoms of being an internet addict:
143 35. Your husband tells you he's had the beard for 2 months.
145 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
146 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
147 \\\ download, build and distribute -- http://www.A-A-P.org ///
148 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///