]>
Commit | Line | Data |
---|---|---|
47612863 AF |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.2.016 | |
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.2.016 | |
11 | Problem: Using ":scscope find" with 'cscopequickfix' does not always split | |
12 | the window. (Gary Johnson) | |
13 | Win32: ":cscope add" could make the script that contains it | |
14 | read-only until the corresponding ":cscope kill". | |
15 | Errors during ":cscope add" may not be handled properly. | |
16 | Solution: When using the quickfix window may need to split the window. | |
17 | Avoid file handle inheritance for the script. | |
18 | Check for a failed connection and/or process. (Sergey Khorev) | |
19 | Files: src/ex_cmds2.c, src/if_cscope.c | |
20 | ||
21 | ||
22 | *** ../vim-6.2.015/src/ex_cmds2.c Thu May 29 11:26:29 2003 | |
23 | --- src/ex_cmds2.c Thu Jun 19 23:42:05 2003 | |
24 | *************** | |
25 | *** 11,17 **** | |
26 | --- 11,26 ---- | |
27 | * ex_cmds2.c: some more functions for command line commands | |
28 | */ | |
29 | ||
30 | + #if defined(WIN32) && defined(FEAT_CSCOPE) | |
31 | + # include <io.h> | |
32 | + #endif | |
33 | + | |
34 | #include "vim.h" | |
35 | + | |
36 | + #if defined(WIN32) && defined(FEAT_CSCOPE) | |
37 | + # include <fcntl.h> | |
38 | + #endif | |
39 | + | |
40 | #include "version.h" | |
41 | ||
42 | static void cmd_source __ARGS((char_u *fname, exarg_T *eap)); | |
43 | *************** | |
44 | *** 2016,2021 **** | |
45 | --- 2025,2049 ---- | |
46 | #define SCRIPT_INO(id) (((struct scriptstuff *)script_names.ga_data)[(id) - 1].ino) | |
47 | #endif | |
48 | ||
49 | + #if defined(WIN32) && defined(FEAT_CSCOPE) | |
50 | + static FILE *fopen_noinh_readbin __ARGS((char *filename)); | |
51 | + | |
52 | + /* | |
53 | + * Special function to open a file without handle inheritance. | |
54 | + */ | |
55 | + static FILE * | |
56 | + fopen_noinh_readbin(filename) | |
57 | + char *filename; | |
58 | + { | |
59 | + int fd_tmp = open(filename, O_RDONLY | O_BINARY | O_NOINHERIT); | |
60 | + | |
61 | + if (fd_tmp == -1) | |
62 | + return NULL; | |
63 | + return fdopen(fd_tmp, READBIN); | |
64 | + } | |
65 | + #endif | |
66 | + | |
67 | + | |
68 | /* | |
69 | * do_source: Read the file "fname" and execute its lines as EX commands. | |
70 | * | |
71 | *************** | |
72 | *** 2070,2076 **** | |
73 | --- 2098,2108 ---- | |
74 | goto theend; | |
75 | } | |
76 | ||
77 | + #if defined(WIN32) && defined(FEAT_CSCOPE) | |
78 | + cookie.fp = fopen_noinh_readbin((char *)fname_exp); | |
79 | + #else | |
80 | cookie.fp = mch_fopen((char *)fname_exp, READBIN); | |
81 | + #endif | |
82 | if (cookie.fp == NULL && check_other) | |
83 | { | |
84 | /* | |
85 | *************** | |
86 | *** 2087,2093 **** | |
87 | --- 2119,2129 ---- | |
88 | *p = '.'; | |
89 | else | |
90 | *p = '_'; | |
91 | + #if defined(WIN32) && defined(FEAT_CSCOPE) | |
92 | + cookie.fp = fopen_noinh_readbin((char *)fname_exp); | |
93 | + #else | |
94 | cookie.fp = mch_fopen((char *)fname_exp, READBIN); | |
95 | + #endif | |
96 | } | |
97 | } | |
98 | ||
99 | *** ../vim-6.2.015/src/if_cscope.c Tue Jun 3 20:40:22 2003 | |
100 | --- src/if_cscope.c Sun Jun 22 17:10:23 2003 | |
101 | *************** | |
102 | *** 517,523 **** | |
103 | --- 517,526 ---- | |
104 | { | |
105 | if (cs_create_connection(i) == CSCOPE_FAILURE | |
106 | || cs_read_prompt(i) == CSCOPE_FAILURE) | |
107 | + { | |
108 | + cs_release_csp(i, TRUE); | |
109 | goto add_err; | |
110 | + } | |
111 | ||
112 | if (p_csverbose) | |
113 | { | |
114 | *************** | |
115 | *** 1095,1101 **** | |
116 | --- 1098,1116 ---- | |
117 | fclose(f); | |
118 | /* '-' starts a new error list */ | |
119 | if (qf_init(tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0) | |
120 | + { | |
121 | + # ifdef FEAT_WINDOWS | |
122 | + if (postponed_split != 0) | |
123 | + { | |
124 | + win_split(postponed_split > 0 ? postponed_split : 0, 0); | |
125 | + # ifdef FEAT_SCROLLBIND | |
126 | + curwin->w_p_scb = FALSE; | |
127 | + # endif | |
128 | + postponed_split = 0; | |
129 | + } | |
130 | + # endif | |
131 | qf_jump(0, 0, forceit); | |
132 | + } | |
133 | mch_remove(tmp); | |
134 | vim_free(tmp); | |
135 | return TRUE; | |
136 | *************** | |
137 | *** 1794,1802 **** | |
138 | #endif | |
139 | ) | |
140 | ; | |
141 | ! if (s > path && *s == '/' | |
142 | #ifdef WIN32 | |
143 | ! || s > path && *s == '\\' | |
144 | #endif | |
145 | ) | |
146 | ++s; | |
147 | --- 1809,1817 ---- | |
148 | #endif | |
149 | ) | |
150 | ; | |
151 | ! if ((s > path && *s == '/') | |
152 | #ifdef WIN32 | |
153 | ! || (s > path && *s == '\\') | |
154 | #endif | |
155 | ) | |
156 | ++s; | |
157 | *************** | |
158 | *** 2081,2090 **** | |
159 | /* | |
160 | * Trying to exit normally (not sure whether it is fit to UNIX cscope | |
161 | */ | |
162 | ! (void)fputs("q\n", csinfo[i].to_fp); | |
163 | ! (void)fflush(csinfo[i].to_fp); | |
164 | /* give cscope chance to exit normally */ | |
165 | ! if (WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT) | |
166 | TerminateProcess(csinfo[i].hProc, 0); | |
167 | #endif | |
168 | ||
169 | --- 2096,2109 ---- | |
170 | /* | |
171 | * Trying to exit normally (not sure whether it is fit to UNIX cscope | |
172 | */ | |
173 | ! if (csinfo[i].to_fp != NULL) | |
174 | ! { | |
175 | ! (void)fputs("q\n", csinfo[i].to_fp); | |
176 | ! (void)fflush(csinfo[i].to_fp); | |
177 | ! } | |
178 | /* give cscope chance to exit normally */ | |
179 | ! if (csinfo[i].hProc > 0 | |
180 | ! && WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT) | |
181 | TerminateProcess(csinfo[i].hProc, 0); | |
182 | #endif | |
183 | ||
184 | *** ../vim-6.2.015/src/version.c Mon Jun 30 22:18:22 2003 | |
185 | --- src/version.c Mon Jun 30 22:25:27 2003 | |
186 | *************** | |
187 | *** 632,633 **** | |
188 | --- 632,635 ---- | |
189 | { /* Add new patch number below this line */ | |
190 | + /**/ | |
191 | + 16, | |
192 | /**/ | |
193 | ||
194 | -- | |
195 | hundred-and-one symptoms of being an internet addict: | |
196 | 264. You turn to the teletext page "surfing report" and are surprised that it | |
197 | is about sizes of waves and a weather forecast for seaside resorts. | |
198 | ||
199 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
200 | /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ | |
201 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
202 | \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html /// |