]>
Commit | Line | Data |
---|---|---|
63868179 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.3.085 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 6.3.085 | |
11 | Problem: Crash in syntax highlighting code. (Marc Espie) | |
12 | Solution: Prevent current_col going past the end of the line. | |
13 | Files: src/syntax.c | |
14 | ||
15 | ||
16 | *** ../vim-6.3.084/src/syntax.c Fri Jul 1 11:20:39 2005 | |
17 | --- src/syntax.c Sun Jul 24 19:39:04 2005 | |
18 | *************** | |
19 | *** 659,664 **** | |
20 | --- 659,665 ---- | |
21 | linenr_T found_current_lnum = 0; | |
22 | int found_current_col= 0; | |
23 | lpos_T found_m_endpos; | |
24 | + colnr_T prev_current_col; | |
25 | ||
26 | /* | |
27 | * Clear any current state that might be hanging around. | |
28 | *************** | |
29 | *** 829,838 **** | |
30 | ++current_col; | |
31 | ||
32 | /* syn_current_attr() will have skipped the check for | |
33 | ! * an item that ends here, need to do that now. */ | |
34 | ! ++current_col; | |
35 | check_state_ends(); | |
36 | ! --current_col; | |
37 | } | |
38 | else | |
39 | break; | |
40 | --- 830,842 ---- | |
41 | ++current_col; | |
42 | ||
43 | /* syn_current_attr() will have skipped the check for | |
44 | ! * an item that ends here, need to do that now. Be | |
45 | ! * careful not to go past the NUL. */ | |
46 | ! prev_current_col = current_col; | |
47 | ! if (syn_getcurline()[current_col] != NUL) | |
48 | ! ++current_col; | |
49 | check_state_ends(); | |
50 | ! current_col = prev_current_col; | |
51 | } | |
52 | else | |
53 | break; | |
54 | *************** | |
55 | *** 1635,1640 **** | |
56 | --- 1639,1645 ---- | |
57 | int syncing; /* called for syncing */ | |
58 | { | |
59 | stateitem_T *cur_si; | |
60 | + colnr_T prev_current_col; | |
61 | ||
62 | if (!current_finished) | |
63 | { | |
64 | *************** | |
65 | *** 1656,1665 **** | |
66 | return TRUE; | |
67 | ||
68 | /* syn_current_attr() will have skipped the check for an item | |
69 | ! * that ends here, need to do that now. */ | |
70 | ! ++current_col; | |
71 | check_state_ends(); | |
72 | ! --current_col; | |
73 | } | |
74 | ++current_col; | |
75 | } | |
76 | --- 1661,1673 ---- | |
77 | return TRUE; | |
78 | ||
79 | /* syn_current_attr() will have skipped the check for an item | |
80 | ! * that ends here, need to do that now. Be careful not to go | |
81 | ! * past the NUL. */ | |
82 | ! prev_current_col = current_col; | |
83 | ! if (syn_getcurline()[current_col] != NUL) | |
84 | ! ++current_col; | |
85 | check_state_ends(); | |
86 | ! current_col = prev_current_col; | |
87 | } | |
88 | ++current_col; | |
89 | } | |
90 | *************** | |
91 | *** 2178,2184 **** | |
92 | if (!syncing) | |
93 | { | |
94 | check_state_ends(); | |
95 | ! if (current_state.ga_len > 0) | |
96 | { | |
97 | ++current_col; | |
98 | check_state_ends(); | |
99 | --- 2186,2193 ---- | |
100 | if (!syncing) | |
101 | { | |
102 | check_state_ends(); | |
103 | ! if (current_state.ga_len > 0 | |
104 | ! && syn_getcurline()[current_col] != NUL) | |
105 | { | |
106 | ++current_col; | |
107 | check_state_ends(); | |
108 | *** ../vim-6.3.084/src/version.c Thu Jul 21 13:49:11 2005 | |
109 | --- src/version.c Sun Jul 24 19:42:30 2005 | |
110 | *************** | |
111 | *** 643,644 **** | |
112 | --- 643,646 ---- | |
113 | { /* Add new patch number below this line */ | |
114 | + /**/ | |
115 | + 85, | |
116 | /**/ | |
117 | ||
118 | -- | |
119 | BEDEVERE: How do you know so much about swallows? | |
120 | ARTHUR: Well you have to know these things when you're a king, you know. | |
121 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
122 | ||
123 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
124 | /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
125 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
126 | \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html /// |