]>
Commit | Line | Data |
---|---|---|
be561239 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.3.026 | |
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.026 | |
11 | Problem: When ~/.vim/after/syntax/syncolor.vim contains a command that | |
12 | reloads the colors an enless loop and/or a crash may occur. | |
13 | Solution: Only free the old value of an option when it was originally | |
14 | allocated. Limit recursiveness of init_highlight() to 5 levels. | |
15 | Files: src/option.c, src/syntax.c | |
16 | ||
17 | ||
18 | *** ../vim-6.3.025/src/option.c Thu Aug 26 16:01:15 2004 | |
19 | --- src/option.c Mon Sep 13 15:42:46 2004 | |
20 | *************** | |
21 | *** 4597,4602 **** | |
22 | --- 4597,4603 ---- | |
23 | char_u *s, *p; | |
24 | int did_chartab = FALSE; | |
25 | char_u **gvarp; | |
26 | + int free_oldval = (options[opt_idx].flags & P_ALLOCED); | |
27 | ||
28 | /* Get the global option to compare with, otherwise we would have to check | |
29 | * two values for all local options. */ | |
30 | *************** | |
31 | *** 5729,5736 **** | |
32 | #endif | |
33 | /* | |
34 | * Free string options that are in allocated memory. | |
35 | */ | |
36 | ! if (options[opt_idx].flags & P_ALLOCED) | |
37 | free_string_option(oldval); | |
38 | if (new_value_alloced) | |
39 | options[opt_idx].flags |= P_ALLOCED; | |
40 | --- 5730,5739 ---- | |
41 | #endif | |
42 | /* | |
43 | * Free string options that are in allocated memory. | |
44 | + * Use "free_oldval", because recursiveness may change the flags under | |
45 | + * our fingers (esp. init_highlight()). | |
46 | */ | |
47 | ! if (free_oldval) | |
48 | free_string_option(oldval); | |
49 | if (new_value_alloced) | |
50 | options[opt_idx].flags |= P_ALLOCED; | |
51 | *** ../vim-6.3.025/src/syntax.c Wed Jun 9 14:56:25 2004 | |
52 | --- src/syntax.c Mon Sep 13 15:44:04 2004 | |
53 | *************** | |
54 | *** 6016,6022 **** | |
55 | * If syntax highlighting is enabled load the highlighting for it. | |
56 | */ | |
57 | if (get_var_value((char_u *)"g:syntax_on") != NULL) | |
58 | ! (void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE); | |
59 | #endif | |
60 | } | |
61 | ||
62 | --- 6016,6033 ---- | |
63 | * If syntax highlighting is enabled load the highlighting for it. | |
64 | */ | |
65 | if (get_var_value((char_u *)"g:syntax_on") != NULL) | |
66 | ! { | |
67 | ! static int recursive = 0; | |
68 | ! | |
69 | ! if (recursive >= 5) | |
70 | ! EMSG(_("E679: recursive loop loading syncolor.vim")); | |
71 | ! else | |
72 | ! { | |
73 | ! ++recursive; | |
74 | ! (void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE); | |
75 | ! --recursive; | |
76 | ! } | |
77 | ! } | |
78 | #endif | |
79 | } | |
80 | ||
81 | *** ../vim-6.3.025/src/version.c Sun Sep 5 20:53:04 2004 | |
82 | --- src/version.c Mon Sep 13 16:33:19 2004 | |
83 | *************** | |
84 | *** 643,644 **** | |
85 | --- 643,646 ---- | |
86 | { /* Add new patch number below this line */ | |
87 | + /**/ | |
88 | + 26, | |
89 | /**/ | |
90 | ||
91 | -- | |
92 | A special law prohibits unmarried women from parachuting on Sunday or she | |
93 | shall risk arrest, fine, and/or jailing. | |
94 | [real standing law in Florida, United States of America] | |
95 | ||
96 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
97 | /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
98 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
99 | \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html /// |