]>
Commit | Line | Data |
---|---|---|
f3c378e8 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.0.153 | |
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 7.0.153 | |
11 | Problem: When using cscope and opening the temp file fails Vim crashes. | |
12 | (Kaya Bekiroglu) | |
13 | Solution: Check for NULL pointer returned from mch_open(). | |
14 | Files: src/if_cscope.c | |
15 | ||
16 | ||
17 | *** ../vim-7.0.152/src/if_cscope.c Tue Aug 29 17:28:56 2006 | |
18 | --- src/if_cscope.c Mon Oct 30 22:26:01 2006 | |
19 | *************** | |
20 | *** 1100,1137 **** | |
21 | if (qfpos != NULL && *qfpos != '0' && totmatches > 0) | |
22 | { | |
23 | /* fill error list */ | |
24 | ! FILE *f; | |
25 | ! char_u *tmp = vim_tempname('c'); | |
26 | qf_info_T *qi = NULL; | |
27 | win_T *wp = NULL; | |
28 | ||
29 | f = mch_fopen((char *)tmp, "w"); | |
30 | ! cs_file_results(f, nummatches); | |
31 | ! fclose(f); | |
32 | ! if (use_ll) /* Use location list */ | |
33 | ! wp = curwin; | |
34 | ! /* '-' starts a new error list */ | |
35 | ! if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0) | |
36 | { | |
37 | ! # ifdef FEAT_WINDOWS | |
38 | ! if (postponed_split != 0) | |
39 | { | |
40 | ! win_split(postponed_split > 0 ? postponed_split : 0, | |
41 | postponed_split_flags); | |
42 | # ifdef FEAT_SCROLLBIND | |
43 | ! curwin->w_p_scb = FALSE; | |
44 | # endif | |
45 | ! postponed_split = 0; | |
46 | ! } | |
47 | # endif | |
48 | ! if (use_ll) | |
49 | ! /* | |
50 | ! * In the location list window, use the displayed location | |
51 | ! * list. Otherwise, use the location list for the window. | |
52 | ! */ | |
53 | ! qi = (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) ? | |
54 | ! wp->w_llist_ref : wp->w_llist; | |
55 | ! qf_jump(qi, 0, 0, forceit); | |
56 | } | |
57 | mch_remove(tmp); | |
58 | vim_free(tmp); | |
59 | --- 1100,1143 ---- | |
60 | if (qfpos != NULL && *qfpos != '0' && totmatches > 0) | |
61 | { | |
62 | /* fill error list */ | |
63 | ! FILE *f; | |
64 | ! char_u *tmp = vim_tempname('c'); | |
65 | qf_info_T *qi = NULL; | |
66 | win_T *wp = NULL; | |
67 | ||
68 | f = mch_fopen((char *)tmp, "w"); | |
69 | ! if (f == NULL) | |
70 | ! EMSG2(_(e_notopen), tmp); | |
71 | ! else | |
72 | { | |
73 | ! cs_file_results(f, nummatches); | |
74 | ! fclose(f); | |
75 | ! if (use_ll) /* Use location list */ | |
76 | ! wp = curwin; | |
77 | ! /* '-' starts a new error list */ | |
78 | ! if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m", | |
79 | ! *qfpos == '-') > 0) | |
80 | { | |
81 | ! # ifdef FEAT_WINDOWS | |
82 | ! if (postponed_split != 0) | |
83 | ! { | |
84 | ! win_split(postponed_split > 0 ? postponed_split : 0, | |
85 | postponed_split_flags); | |
86 | # ifdef FEAT_SCROLLBIND | |
87 | ! curwin->w_p_scb = FALSE; | |
88 | # endif | |
89 | ! postponed_split = 0; | |
90 | ! } | |
91 | # endif | |
92 | ! if (use_ll) | |
93 | ! /* | |
94 | ! * In the location list window, use the displayed location | |
95 | ! * list. Otherwise, use the location list for the window. | |
96 | ! */ | |
97 | ! qi = (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) | |
98 | ! ? wp->w_llist_ref : wp->w_llist; | |
99 | ! qf_jump(qi, 0, 0, forceit); | |
100 | ! } | |
101 | } | |
102 | mch_remove(tmp); | |
103 | vim_free(tmp); | |
104 | *************** | |
105 | *** 1723,1729 **** | |
106 | continue; | |
107 | ||
108 | context = (char *)alloc((unsigned)strlen(cntx)+5); | |
109 | ! if (context==NULL) | |
110 | continue; | |
111 | ||
112 | if (strcmp(cntx, "<global>")==0) | |
113 | --- 1729,1735 ---- | |
114 | continue; | |
115 | ||
116 | context = (char *)alloc((unsigned)strlen(cntx)+5); | |
117 | ! if (context == NULL) | |
118 | continue; | |
119 | ||
120 | if (strcmp(cntx, "<global>")==0) | |
121 | *************** | |
122 | *** 1731,1737 **** | |
123 | else | |
124 | sprintf(context, "<<%s>>", cntx); | |
125 | ||
126 | ! if (search==NULL) | |
127 | fprintf(f, "%s\t%s\t%s\n", fullname, slno, context); | |
128 | else | |
129 | fprintf(f, "%s\t%s\t%s %s\n", fullname, slno, context, search); | |
130 | --- 1737,1743 ---- | |
131 | else | |
132 | sprintf(context, "<<%s>>", cntx); | |
133 | ||
134 | ! if (search == NULL) | |
135 | fprintf(f, "%s\t%s\t%s\n", fullname, slno, context); | |
136 | else | |
137 | fprintf(f, "%s\t%s\t%s %s\n", fullname, slno, context, search); | |
138 | *** ../vim-7.0.152/src/version.c Tue Oct 24 22:31:51 2006 | |
139 | --- src/version.c Mon Oct 30 22:29:45 2006 | |
140 | *************** | |
141 | *** 668,669 **** | |
142 | --- 668,671 ---- | |
143 | { /* Add new patch number below this line */ | |
144 | + /**/ | |
145 | + 153, | |
146 | /**/ | |
147 | ||
148 | -- | |
149 | You cannot have a baby in one month by getting nine women pregnant. | |
150 | ||
151 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
152 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
153 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
154 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |