4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When using cscope and opening the temp file fails Vim crashes.
13 Solution: Check for NULL pointer returned from mch_open().
14 Files: src/if_cscope.c
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
21 if (qfpos != NULL && *qfpos != '0' && totmatches > 0)
25 ! char_u *tmp = vim_tempname('c');
29 f = mch_fopen((char *)tmp, "w");
30 ! cs_file_results(f, nummatches);
32 ! if (use_ll) /* Use location list */
34 ! /* '-' starts a new error list */
35 ! if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0)
37 ! # ifdef FEAT_WINDOWS
38 ! if (postponed_split != 0)
40 ! win_split(postponed_split > 0 ? postponed_split : 0,
41 postponed_split_flags);
42 # ifdef FEAT_SCROLLBIND
43 ! curwin->w_p_scb = FALSE;
45 ! postponed_split = 0;
50 ! * In the location list window, use the displayed location
51 ! * list. Otherwise, use the location list for the window.
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);
60 if (qfpos != NULL && *qfpos != '0' && totmatches > 0)
64 ! char_u *tmp = vim_tempname('c');
68 f = mch_fopen((char *)tmp, "w");
70 ! EMSG2(_(e_notopen), tmp);
73 ! cs_file_results(f, nummatches);
75 ! if (use_ll) /* Use location list */
77 ! /* '-' starts a new error list */
78 ! if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m",
81 ! # ifdef FEAT_WINDOWS
82 ! if (postponed_split != 0)
84 ! win_split(postponed_split > 0 ? postponed_split : 0,
85 postponed_split_flags);
86 # ifdef FEAT_SCROLLBIND
87 ! curwin->w_p_scb = FALSE;
89 ! postponed_split = 0;
94 ! * In the location list window, use the displayed location
95 ! * list. Otherwise, use the location list for the window.
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);
108 context = (char *)alloc((unsigned)strlen(cntx)+5);
112 if (strcmp(cntx, "<global>")==0)
116 context = (char *)alloc((unsigned)strlen(cntx)+5);
117 ! if (context == NULL)
120 if (strcmp(cntx, "<global>")==0)
124 sprintf(context, "<<%s>>", cntx);
127 fprintf(f, "%s\t%s\t%s\n", fullname, slno, context);
129 fprintf(f, "%s\t%s\t%s %s\n", fullname, slno, context, search);
132 sprintf(context, "<<%s>>", cntx);
134 ! if (search == NULL)
135 fprintf(f, "%s\t%s\t%s\n", fullname, slno, context);
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
143 { /* Add new patch number below this line */
149 You cannot have a baby in one month by getting nine women pregnant.
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 ///