]>
Commit | Line | Data |
---|---|---|
3cc08688 AM |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.3.076 | |
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.076 | |
11 | Problem: Crash when using cscope and there is a parse error (e.g., line too | |
12 | long). (Alexey I. Froloff) | |
13 | Solution: Pass the actual number of matches to cs_manage_matches() and | |
14 | correctly handle the error situation. | |
15 | Files: src/if_cscope.c | |
16 | ||
17 | ||
18 | *** ../vim-6.3.075/src/if_cscope.c Wed Jun 9 14:56:27 2004 | |
19 | --- src/if_cscope.c Tue Jun 7 11:06:19 2005 | |
20 | *************** | |
21 | *** 1,7 **** | |
22 | /* vi:set ts=8 sts=4 sw=4: | |
23 | * | |
24 | * CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com> | |
25 | ! * Ported to Win32 by Sergey Khorev <khorev@softlab.ru> | |
26 | * | |
27 | * The basic idea/structure of cscope for Vim was borrowed from Nvi. There | |
28 | * might be a few lines of code that look similar to what Nvi has. | |
29 | --- 1,7 ---- | |
30 | /* vi:set ts=8 sts=4 sw=4: | |
31 | * | |
32 | * CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com> | |
33 | ! * Ported to Win32 by Sergey Khorev <sergey.khorev@gmail.com> | |
34 | * | |
35 | * The basic idea/structure of cscope for Vim was borrowed from Nvi. There | |
36 | * might be a few lines of code that look similar to what Nvi has. | |
37 | *************** | |
38 | *** 1130,1136 **** | |
39 | if (matches == NULL) | |
40 | return FALSE; | |
41 | ||
42 | ! (void)cs_manage_matches(matches, contexts, totmatches, Store); | |
43 | ||
44 | return do_tag((char_u *)pat, DT_CSCOPE, 0, forceit, verbose); | |
45 | } | |
46 | --- 1130,1136 ---- | |
47 | if (matches == NULL) | |
48 | return FALSE; | |
49 | ||
50 | ! (void)cs_manage_matches(matches, contexts, matched, Store); | |
51 | ||
52 | return do_tag((char_u *)pat, DT_CSCOPE, 0, forceit, verbose); | |
53 | } | |
54 | *************** | |
55 | *** 1726,1731 **** | |
56 | --- 1726,1732 ---- | |
57 | * | |
58 | * get parsed cscope output and calls cs_make_vim_style_matches to convert | |
59 | * into ctags format | |
60 | + * When there are no matches sets "*matches_p" to NULL. | |
61 | */ | |
62 | static void | |
63 | cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched) | |
64 | *************** | |
65 | *** 1790,1795 **** | |
66 | --- 1791,1804 ---- | |
67 | } /* for all cscope connections */ | |
68 | ||
69 | parse_out: | |
70 | + if (totsofar == 0) | |
71 | + { | |
72 | + /* No matches, free the arrays and return NULL in "*matches_p". */ | |
73 | + vim_free(matches); | |
74 | + matches = NULL; | |
75 | + vim_free(cntxts); | |
76 | + cntxts = NULL; | |
77 | + } | |
78 | *matched = totsofar; | |
79 | *matches_p = matches; | |
80 | *cntxts_p = cntxts; | |
81 | *************** | |
82 | *** 2125,2131 **** | |
83 | { | |
84 | char **dblist = NULL, **pplist = NULL, **fllist = NULL; | |
85 | int i; | |
86 | ! char buf[8]; /* for sprintf " (#%d)" */ | |
87 | ||
88 | /* malloc our db and ppath list */ | |
89 | dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); | |
90 | --- 2134,2140 ---- | |
91 | { | |
92 | char **dblist = NULL, **pplist = NULL, **fllist = NULL; | |
93 | int i; | |
94 | ! char buf[20]; /* for sprintf " (#%d)" */ | |
95 | ||
96 | /* malloc our db and ppath list */ | |
97 | dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); | |
98 | *** ../vim-6.3.075/src/version.c Tue May 31 21:30:24 2005 | |
99 | --- src/version.c Tue Jun 7 11:06:46 2005 | |
100 | *************** | |
101 | *** 643,644 **** | |
102 | --- 643,646 ---- | |
103 | { /* Add new patch number below this line */ | |
104 | + /**/ | |
105 | + 76, | |
106 | /**/ | |
107 | ||
108 | -- | |
109 | Despite the cost of living, have you noticed how it remains so popular? | |
110 | ||
111 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
112 | /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
113 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
114 | \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html /// |