Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/evalfile.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||
14 | int sourcelevel = 0; | - | ||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||
16 | static int | - | ||||||||||||||||||||||||
17 | _evalfile (filename, flags) | - | ||||||||||||||||||||||||
18 | const char *filename; | - | ||||||||||||||||||||||||
19 | int flags; | - | ||||||||||||||||||||||||
20 | { | - | ||||||||||||||||||||||||
21 | volatile int old_interactive; | - | ||||||||||||||||||||||||
22 | sigjmp_buf old_return_catch; | - | ||||||||||||||||||||||||
23 | int return_val, fd, result, pflags, i, nnull; | - | ||||||||||||||||||||||||
24 | ssize_t nr; | - | ||||||||||||||||||||||||
25 | char *string; | - | ||||||||||||||||||||||||
26 | struct stat finfo; | - | ||||||||||||||||||||||||
27 | size_t file_size; | - | ||||||||||||||||||||||||
28 | sh_vmsg_func_t *errfunc; | - | ||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||
30 | SHELL_VAR *funcname_v, *bash_source_v, *bash_lineno_v; | - | ||||||||||||||||||||||||
31 | ARRAY *funcname_a, *bash_source_a, *bash_lineno_a; | - | ||||||||||||||||||||||||
32 | struct func_array_state *fa; | - | ||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||
34 | SHELL_VAR *bash_argv_v, *bash_argc_v; | - | ||||||||||||||||||||||||
35 | ARRAY *bash_argv_a, *bash_argc_a; | - | ||||||||||||||||||||||||
36 | - | |||||||||||||||||||||||||
37 | char *t, tt[2]; | - | ||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||
40 | ((void) &(pflags)); | - | ||||||||||||||||||||||||
41 | - | |||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||
43 | do { (funcname_v) = find_variable ("FUNCNAME"); (funcname_a) = ((funcname_v) && (((((funcname_v))->attributes) & (0x0000004)))) ? (ARRAY *)((funcname_v)->value) : (ARRAY *)0; } while (0); | - | ||||||||||||||||||||||||
44 | do { (bash_source_v) = find_variable ("BASH_SOURCE"); (bash_source_a) = ((bash_source_v) && (((((bash_source_v))->attributes) & (0x0000004)))) ? (ARRAY *)((bash_source_v)->value) : (ARRAY *)0; } while (0); | - | ||||||||||||||||||||||||
45 | do { (bash_lineno_v) = find_variable ("BASH_LINENO"); (bash_lineno_a) = ((bash_lineno_v) && (((((bash_lineno_v))->attributes) & (0x0000004)))) ? (ARRAY *)((bash_lineno_v)->value) : (ARRAY *)0; } while (0); | - | ||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||
47 | do { (bash_argv_v) = find_variable ("BASH_ARGV"); (bash_argv_a) = ((bash_argv_v) && (((((bash_argv_v))->attributes) & (0x0000004)))) ? (ARRAY *)((bash_argv_v)->value) : (ARRAY *)0; } while (0); | - | ||||||||||||||||||||||||
48 | do { (bash_argc_v) = find_variable ("BASH_ARGC"); (bash_argc_a) = ((bash_argc_v) && (((((bash_argc_v))->attributes) & (0x0000004)))) ? (ARRAY *)((bash_argc_v)->value) : (ARRAY *)0; } while (0); | - | ||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||
52 | fd = open (filename, | - | ||||||||||||||||||||||||
53 | 00 | - | ||||||||||||||||||||||||
54 | ); | - | ||||||||||||||||||||||||
55 | - | |||||||||||||||||||||||||
56 | if (fd < 0
| 0-1402 | ||||||||||||||||||||||||
57 | { | - | ||||||||||||||||||||||||
58 | i = | - | ||||||||||||||||||||||||
59 | (*__errno_location ()) | - | ||||||||||||||||||||||||
60 | ; | - | ||||||||||||||||||||||||
61 | if (fd >= 0
| 0-3 | ||||||||||||||||||||||||
62 | close (fd); never executed: close (fd); | 0 | ||||||||||||||||||||||||
63 | - | |||||||||||||||||||||||||
64 | (*__errno_location ()) | - | ||||||||||||||||||||||||
65 | = i; | - | ||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||
67 | file_error_and_exit: code before this statement executed 3 times by 1 test: file_error_and_exit: Executed by:
| 3 | ||||||||||||||||||||||||
68 | if (((
| 0-3 | ||||||||||||||||||||||||
69 | (*
| 0 | ||||||||||||||||||||||||
70 | !=
| 0 | ||||||||||||||||||||||||
71 | 2
| 0 | ||||||||||||||||||||||||
72 | ) | - | ||||||||||||||||||||||||
73 | file_error (filename); executed 3 times by 1 test: file_error (filename); Executed by:
| 3 | ||||||||||||||||||||||||
74 | - | |||||||||||||||||||||||||
75 | if (flags & 0x010
| 1-2 | ||||||||||||||||||||||||
76 | { | - | ||||||||||||||||||||||||
77 | last_command_exit_value = 1; | - | ||||||||||||||||||||||||
78 | jump_to_top_level (3); | - | ||||||||||||||||||||||||
79 | } never executed: end of block | 0 | ||||||||||||||||||||||||
80 | - | |||||||||||||||||||||||||
81 | return executed 2 times by 1 test: ((flags & 0x002) ? 1return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
| 2 | ||||||||||||||||||||||||
82 | : (( executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
| 2 | ||||||||||||||||||||||||
83 | (*__errno_location ()) executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
| 2 | ||||||||||||||||||||||||
84 | == executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
| 2 | ||||||||||||||||||||||||
85 | 2 executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
| 2 | ||||||||||||||||||||||||
86 | && (flags & 0x001) != 0) ? 0 : -1)); executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1)); Executed by:
| 2 | ||||||||||||||||||||||||
87 | } | - | ||||||||||||||||||||||||
88 | - | |||||||||||||||||||||||||
89 | errfunc = ((
| 3-1399 | ||||||||||||||||||||||||
90 | - | |||||||||||||||||||||||||
91 | if ( | - | ||||||||||||||||||||||||
92 | ((((
| 9-1393 | ||||||||||||||||||||||||
93 | finfo.st_mode
| 9-1393 | ||||||||||||||||||||||||
94 | )) & 0170000) == (0040000))
| 9-1393 | ||||||||||||||||||||||||
95 | ) | - | ||||||||||||||||||||||||
96 | { | - | ||||||||||||||||||||||||
97 | (*errfunc) ( | - | ||||||||||||||||||||||||
98 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
99 | "%s: is a directory" | - | ||||||||||||||||||||||||
100 | , 5) | - | ||||||||||||||||||||||||
101 | , filename); | - | ||||||||||||||||||||||||
102 | close (fd); | - | ||||||||||||||||||||||||
103 | return executed 9 times by 1 test: ((flags & 0x002) ? 1 : -1);return ((flags & 0x002) ? 1 : -1); Executed by:
executed 9 times by 1 test: return ((flags & 0x002) ? 1 : -1); Executed by:
| 9 | ||||||||||||||||||||||||
104 | } | - | ||||||||||||||||||||||||
105 | else if ((
| 2-1391 | ||||||||||||||||||||||||
106 | ((((
| 0-2 | ||||||||||||||||||||||||
107 | finfo.st_mode
| 0-2 | ||||||||||||||||||||||||
108 | )) & 0170000) == (0100000))
| 0-2 | ||||||||||||||||||||||||
109 | == 0
| 0-2 | ||||||||||||||||||||||||
110 | { | - | ||||||||||||||||||||||||
111 | (*errfunc) ( | - | ||||||||||||||||||||||||
112 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
113 | "%s: not a regular file" | - | ||||||||||||||||||||||||
114 | , 5) | - | ||||||||||||||||||||||||
115 | , filename); | - | ||||||||||||||||||||||||
116 | close (fd); | - | ||||||||||||||||||||||||
117 | return never executed: ((flags & 0x002) ? 1 : -1);return ((flags & 0x002) ? 1 : -1); never executed: return ((flags & 0x002) ? 1 : -1); | 0 | ||||||||||||||||||||||||
118 | } | - | ||||||||||||||||||||||||
119 | - | |||||||||||||||||||||||||
120 | file_size = (size_t)finfo.st_size; | - | ||||||||||||||||||||||||
121 | - | |||||||||||||||||||||||||
122 | if (file_size != finfo.st_size
| 0-1393 | ||||||||||||||||||||||||
123 | { | - | ||||||||||||||||||||||||
124 | (*errfunc) ( | - | ||||||||||||||||||||||||
125 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
126 | "%s: file is too large" | - | ||||||||||||||||||||||||
127 | , 5) | - | ||||||||||||||||||||||||
128 | , filename); | - | ||||||||||||||||||||||||
129 | close (fd); | - | ||||||||||||||||||||||||
130 | return never executed: ((flags & 0x002) ? 1 : -1);return ((flags & 0x002) ? 1 : -1); never executed: return ((flags & 0x002) ? 1 : -1); | 0 | ||||||||||||||||||||||||
131 | } | - | ||||||||||||||||||||||||
132 | - | |||||||||||||||||||||||||
133 | if ( | - | ||||||||||||||||||||||||
134 | ((((
| 20-1373 | ||||||||||||||||||||||||
135 | finfo.st_mode
| 20-1373 | ||||||||||||||||||||||||
136 | )) & 0170000) == (0100000))
| 20-1373 | ||||||||||||||||||||||||
137 | && file_size <= 0x7fffffffffffffffL
| 0-1373 | ||||||||||||||||||||||||
138 | { | - | ||||||||||||||||||||||||
139 | string = (char *)sh_xmalloc((1 + file_size), "evalfile.c", 160); | - | ||||||||||||||||||||||||
140 | nr = read (fd, string, file_size); | - | ||||||||||||||||||||||||
141 | if (nr >= 0
| 0-1373 | ||||||||||||||||||||||||
142 | string[nr] = '\0'; executed 1373 times by 1 test: string[nr] = '\0'; Executed by:
| 1373 | ||||||||||||||||||||||||
143 | } executed 1373 times by 1 test: end of block Executed by:
| 1373 | ||||||||||||||||||||||||
144 | else | - | ||||||||||||||||||||||||
145 | nr = zmapfd (fd, &string, 0); executed 20 times by 1 test: nr = zmapfd (fd, &string, 0); Executed by:
| 20 | ||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||
147 | return_val = | - | ||||||||||||||||||||||||
148 | (*__errno_location ()) | - | ||||||||||||||||||||||||
149 | ; | - | ||||||||||||||||||||||||
150 | close (fd); | - | ||||||||||||||||||||||||
151 | - | |||||||||||||||||||||||||
152 | (*__errno_location ()) | - | ||||||||||||||||||||||||
153 | = return_val; | - | ||||||||||||||||||||||||
154 | - | |||||||||||||||||||||||||
155 | if (nr < 0
| 0-1393 | ||||||||||||||||||||||||
156 | { | - | ||||||||||||||||||||||||
157 | sh_xfree((string), "evalfile.c", 174); | - | ||||||||||||||||||||||||
158 | goto never executed: file_error_and_exit;goto file_error_and_exit; never executed: goto file_error_and_exit; | 0 | ||||||||||||||||||||||||
159 | } | - | ||||||||||||||||||||||||
160 | - | |||||||||||||||||||||||||
161 | if (nr == 0
| 21-1372 | ||||||||||||||||||||||||
162 | { | - | ||||||||||||||||||||||||
163 | sh_xfree((string), "evalfile.c", 180); | - | ||||||||||||||||||||||||
164 | return executed 21 times by 1 test: ((flags & 0x002) ? 0 : 1);return ((flags & 0x002) ? 0 : 1); Executed by:
executed 21 times by 1 test: return ((flags & 0x002) ? 0 : 1); Executed by:
| 21 | ||||||||||||||||||||||||
165 | } | - | ||||||||||||||||||||||||
166 | - | |||||||||||||||||||||||||
167 | if ((
| 0-1372 | ||||||||||||||||||||||||
168 | check_binary_file (string, (nr > 80) ? 80 : nr)
| 0 | ||||||||||||||||||||||||
169 | { | - | ||||||||||||||||||||||||
170 | sh_xfree((string), "evalfile.c", 187); | - | ||||||||||||||||||||||||
171 | (*errfunc) ( | - | ||||||||||||||||||||||||
172 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
173 | "%s: cannot execute binary file" | - | ||||||||||||||||||||||||
174 | , 5) | - | ||||||||||||||||||||||||
175 | , filename); | - | ||||||||||||||||||||||||
176 | return never executed: ((flags & 0x002) ? 126 : -1);return ((flags & 0x002) ? 126 : -1); never executed: return ((flags & 0x002) ? 126 : -1); | 0 | ||||||||||||||||||||||||
177 | } | - | ||||||||||||||||||||||||
178 | - | |||||||||||||||||||||||||
179 | i = strlen (string); | - | ||||||||||||||||||||||||
180 | if (i < nr
| 9-1363 | ||||||||||||||||||||||||
181 | { | - | ||||||||||||||||||||||||
182 | for (nnull = i = 0; i < nr
| 0-3276 | ||||||||||||||||||||||||
183 | if (string[i] == '\0'
| 963-2313 | ||||||||||||||||||||||||
184 | { | - | ||||||||||||||||||||||||
185 | memmove (string+i, string+i+1, nr - i); | - | ||||||||||||||||||||||||
186 | nr--; | - | ||||||||||||||||||||||||
187 | - | |||||||||||||||||||||||||
188 | - | |||||||||||||||||||||||||
189 | - | |||||||||||||||||||||||||
190 | if ((
| 0-2313 | ||||||||||||||||||||||||
191 | { | - | ||||||||||||||||||||||||
192 | sh_xfree((string), "evalfile.c", 205); | - | ||||||||||||||||||||||||
193 | (*errfunc) ( | - | ||||||||||||||||||||||||
194 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
195 | "%s: cannot execute binary file" | - | ||||||||||||||||||||||||
196 | , 5) | - | ||||||||||||||||||||||||
197 | , filename); | - | ||||||||||||||||||||||||
198 | return executed 9 times by 1 test: ((flags & 0x002) ? 126 : -1);return ((flags & 0x002) ? 126 : -1); Executed by:
executed 9 times by 1 test: return ((flags & 0x002) ? 126 : -1); Executed by:
| 9 | ||||||||||||||||||||||||
199 | } | - | ||||||||||||||||||||||||
200 | } executed 2304 times by 1 test: end of block Executed by:
| 2304 | ||||||||||||||||||||||||
201 | } never executed: end of block | 0 | ||||||||||||||||||||||||
202 | - | |||||||||||||||||||||||||
203 | if (flags & 0x004
| 5-1358 | ||||||||||||||||||||||||
204 | { | - | ||||||||||||||||||||||||
205 | begin_unwind_frame ("_evalfile"); | - | ||||||||||||||||||||||||
206 | - | |||||||||||||||||||||||||
207 | unwind_protect_mem ((char *)&(return_catch_flag), sizeof (return_catch_flag)); | - | ||||||||||||||||||||||||
208 | unwind_protect_mem ((char *)&(return_catch), sizeof (return_catch)); | - | ||||||||||||||||||||||||
209 | if (flags & 0x008
| 0-1358 | ||||||||||||||||||||||||
210 | unwind_protect_mem ((char *)&(interactive), sizeof (interactive)); executed 1358 times by 1 test: unwind_protect_mem ((char *)&(interactive), sizeof (interactive)); Executed by:
| 1358 | ||||||||||||||||||||||||
211 | unwind_protect_mem ((char *)&(sourcelevel), sizeof (sourcelevel)); | - | ||||||||||||||||||||||||
212 | } executed 1358 times by 1 test: end of block Executed by:
| 1358 | ||||||||||||||||||||||||
213 | else | - | ||||||||||||||||||||||||
214 | { | - | ||||||||||||||||||||||||
215 | xbcopy ((char *)return_catch, (char *)old_return_catch, sizeof (sigjmp_buf));; | - | ||||||||||||||||||||||||
216 | if (flags & 0x008
| 2-3 | ||||||||||||||||||||||||
217 | old_interactive = interactive; executed 3 times by 1 test: old_interactive = interactive; Executed by:
| 3 | ||||||||||||||||||||||||
218 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
219 | - | |||||||||||||||||||||||||
220 | if (flags & 0x008
| 2-1361 | ||||||||||||||||||||||||
221 | interactive = 0; executed 1361 times by 1 test: interactive = 0; Executed by:
| 1361 | ||||||||||||||||||||||||
222 | - | |||||||||||||||||||||||||
223 | return_catch_flag++; | - | ||||||||||||||||||||||||
224 | sourcelevel++; | - | ||||||||||||||||||||||||
225 | - | |||||||||||||||||||||||||
226 | - | |||||||||||||||||||||||||
227 | do { array_rshift ((bash_source_a), 1, ((char *)filename)); } while (0); | - | ||||||||||||||||||||||||
228 | t = itos (executing_line_number ()); | - | ||||||||||||||||||||||||
229 | do { array_rshift ((bash_lineno_a), 1, (t)); } while (0); | - | ||||||||||||||||||||||||
230 | sh_xfree((t), "evalfile.c", 239); | - | ||||||||||||||||||||||||
231 | do { array_rshift ((funcname_a), 1, ("source")); } while (0); | - | ||||||||||||||||||||||||
232 | - | |||||||||||||||||||||||||
233 | fa = (struct func_array_state *)sh_xmalloc((sizeof (struct func_array_state)), "evalfile.c", 242); | - | ||||||||||||||||||||||||
234 | fa->source_a = bash_source_a; | - | ||||||||||||||||||||||||
235 | fa->source_v = bash_source_v; | - | ||||||||||||||||||||||||
236 | fa->lineno_a = bash_lineno_a; | - | ||||||||||||||||||||||||
237 | fa->lineno_v = bash_lineno_v; | - | ||||||||||||||||||||||||
238 | fa->funcname_a = funcname_a; | - | ||||||||||||||||||||||||
239 | fa->funcname_v = funcname_v; | - | ||||||||||||||||||||||||
240 | if (flags & 0x004
| 5-1358 | ||||||||||||||||||||||||
241 | add_unwind_protect (restore_funcarray_state, fa); executed 1358 times by 1 test: add_unwind_protect (restore_funcarray_state, fa); Executed by:
| 1358 | ||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||
245 | - | |||||||||||||||||||||||||
246 | if ((
| 156-1207 | ||||||||||||||||||||||||
247 | { | - | ||||||||||||||||||||||||
248 | if (shell_compatibility_level <= 44
| 0-156 | ||||||||||||||||||||||||
249 | init_bash_argv (); never executed: init_bash_argv (); | 0 | ||||||||||||||||||||||||
250 | do { array_rshift ((bash_argv_a), 1, ((char *)filename)); } while (0); | - | ||||||||||||||||||||||||
251 | tt[0] = '1'; tt[1] = '\0'; | - | ||||||||||||||||||||||||
252 | do { array_rshift ((bash_argc_a), 1, (tt)); } while (0); | - | ||||||||||||||||||||||||
253 | if (flags & 0x004
| 5-151 | ||||||||||||||||||||||||
254 | add_unwind_protect (pop_args, 0); executed 151 times by 1 test: add_unwind_protect (pop_args, 0); Executed by:
| 151 | ||||||||||||||||||||||||
255 | } executed 156 times by 1 test: end of block Executed by:
| 156 | ||||||||||||||||||||||||
256 | - | |||||||||||||||||||||||||
257 | - | |||||||||||||||||||||||||
258 | - | |||||||||||||||||||||||||
259 | - | |||||||||||||||||||||||||
260 | pflags = 0x010; | - | ||||||||||||||||||||||||
261 | pflags |= (
| 2-1361 | ||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||
263 | if (flags & 0x002
| 3-1360 | ||||||||||||||||||||||||
264 | result = 0; executed 1360 times by 1 test: result = 0; Executed by:
| 1360 | ||||||||||||||||||||||||
265 | - | |||||||||||||||||||||||||
266 | return_val = | - | ||||||||||||||||||||||||
267 | __sigsetjmp ( | - | ||||||||||||||||||||||||
268 | (return_catch) | - | ||||||||||||||||||||||||
269 | , | - | ||||||||||||||||||||||||
270 | 0 | - | ||||||||||||||||||||||||
271 | ) | - | ||||||||||||||||||||||||
272 | ; | - | ||||||||||||||||||||||||
273 | - | |||||||||||||||||||||||||
274 | - | |||||||||||||||||||||||||
275 | - | |||||||||||||||||||||||||
276 | if (return_val
| 8-1363 | ||||||||||||||||||||||||
277 | { | - | ||||||||||||||||||||||||
278 | parse_and_execute_cleanup (); | - | ||||||||||||||||||||||||
279 | result = return_catch_value; | - | ||||||||||||||||||||||||
280 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
281 | else | - | ||||||||||||||||||||||||
282 | result = parse_and_execute (string, filename, pflags); executed 1363 times by 1 test: result = parse_and_execute (string, filename, pflags); Executed by:
| 1363 | ||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||
284 | if (flags & 0x004
| 4-1345 | ||||||||||||||||||||||||
285 | run_unwind_frame ("_evalfile"); executed 1345 times by 1 test: run_unwind_frame ("_evalfile"); Executed by:
| 1345 | ||||||||||||||||||||||||
286 | else | - | ||||||||||||||||||||||||
287 | { | - | ||||||||||||||||||||||||
288 | if (flags & 0x008
| 2 | ||||||||||||||||||||||||
289 | interactive = old_interactive; executed 2 times by 1 test: interactive = old_interactive; Executed by:
| 2 | ||||||||||||||||||||||||
290 | - | |||||||||||||||||||||||||
291 | restore_funcarray_state (fa); | - | ||||||||||||||||||||||||
292 | - | |||||||||||||||||||||||||
293 | if ((
| 0-4 | ||||||||||||||||||||||||
294 | { | - | ||||||||||||||||||||||||
295 | - | |||||||||||||||||||||||||
296 | - | |||||||||||||||||||||||||
297 | do { array_dispose_element (array_shift ((bash_argc_a), 1, 0)); } while (0); | - | ||||||||||||||||||||||||
298 | do { array_dispose_element (array_shift ((bash_argv_a), 1, 0)); } while (0); | - | ||||||||||||||||||||||||
299 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||
302 | return_catch_flag--; | - | ||||||||||||||||||||||||
303 | sourcelevel--; | - | ||||||||||||||||||||||||
304 | xbcopy ((char *)old_return_catch, (char *)return_catch, sizeof (sigjmp_buf));; | - | ||||||||||||||||||||||||
305 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
306 | - | |||||||||||||||||||||||||
307 | - | |||||||||||||||||||||||||
308 | - | |||||||||||||||||||||||||
309 | if (current_token == 304
| 0-1349 | ||||||||||||||||||||||||
310 | push_token ('\n'); never executed: push_token ('\n'); | 0 | ||||||||||||||||||||||||
311 | - | |||||||||||||||||||||||||
312 | return executed 1349 times by 1 test: ((flags & 0x002) ? result : 1);return ((flags & 0x002) ? result : 1); Executed by:
executed 1349 times by 1 test: return ((flags & 0x002) ? result : 1); Executed by:
| 1349 | ||||||||||||||||||||||||
313 | } | - | ||||||||||||||||||||||||
314 | - | |||||||||||||||||||||||||
315 | int | - | ||||||||||||||||||||||||
316 | maybe_execute_file (fname, force_noninteractive) | - | ||||||||||||||||||||||||
317 | const char *fname; | - | ||||||||||||||||||||||||
318 | int force_noninteractive; | - | ||||||||||||||||||||||||
319 | { | - | ||||||||||||||||||||||||
320 | char *filename; | - | ||||||||||||||||||||||||
321 | int result, flags; | - | ||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||
323 | filename = bash_tilde_expand (fname, 0); | - | ||||||||||||||||||||||||
324 | flags = 0x001; | - | ||||||||||||||||||||||||
325 | if (force_noninteractive
| 0-3 | ||||||||||||||||||||||||
326 | flags |= 0x008; executed 3 times by 1 test: flags |= 0x008; Executed by:
| 3 | ||||||||||||||||||||||||
327 | result = _evalfile (filename, flags); | - | ||||||||||||||||||||||||
328 | sh_xfree((filename), "evalfile.c", 331); | - | ||||||||||||||||||||||||
329 | return executed 2 times by 1 test: result;return result; Executed by:
executed 2 times by 1 test: return result; Executed by:
| 2 | ||||||||||||||||||||||||
330 | } | - | ||||||||||||||||||||||||
331 | - | |||||||||||||||||||||||||
332 | int | - | ||||||||||||||||||||||||
333 | force_execute_file (fname, force_noninteractive) | - | ||||||||||||||||||||||||
334 | const char *fname; | - | ||||||||||||||||||||||||
335 | int force_noninteractive; | - | ||||||||||||||||||||||||
336 | { | - | ||||||||||||||||||||||||
337 | char *filename; | - | ||||||||||||||||||||||||
338 | int result, flags; | - | ||||||||||||||||||||||||
339 | - | |||||||||||||||||||||||||
340 | filename = bash_tilde_expand (fname, 0); | - | ||||||||||||||||||||||||
341 | flags = 0; | - | ||||||||||||||||||||||||
342 | if (force_noninteractive
| 0 | ||||||||||||||||||||||||
343 | flags |= 0x008; never executed: flags |= 0x008; | 0 | ||||||||||||||||||||||||
344 | result = _evalfile (filename, flags); | - | ||||||||||||||||||||||||
345 | sh_xfree((filename), "evalfile.c", 348); | - | ||||||||||||||||||||||||
346 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||
347 | } | - | ||||||||||||||||||||||||
348 | - | |||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||
350 | int | - | ||||||||||||||||||||||||
351 | fc_execute_file (filename) | - | ||||||||||||||||||||||||
352 | const char *filename; | - | ||||||||||||||||||||||||
353 | { | - | ||||||||||||||||||||||||
354 | int flags; | - | ||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||
357 | - | |||||||||||||||||||||||||
358 | - | |||||||||||||||||||||||||
359 | flags = 0x001|0x020|0x080|0x002; | - | ||||||||||||||||||||||||
360 | return executed 2 times by 1 test: (_evalfile (filename, flags));return (_evalfile (filename, flags)); Executed by:
executed 2 times by 1 test: return (_evalfile (filename, flags)); Executed by:
| 2 | ||||||||||||||||||||||||
361 | } | - | ||||||||||||||||||||||||
362 | - | |||||||||||||||||||||||||
363 | - | |||||||||||||||||||||||||
364 | int | - | ||||||||||||||||||||||||
365 | source_file (filename, sflags) | - | ||||||||||||||||||||||||
366 | const char *filename; | - | ||||||||||||||||||||||||
367 | int sflags; | - | ||||||||||||||||||||||||
368 | { | - | ||||||||||||||||||||||||
369 | int flags, rval; | - | ||||||||||||||||||||||||
370 | - | |||||||||||||||||||||||||
371 | flags = 0x002|0x004|0x008; | - | ||||||||||||||||||||||||
372 | if (sflags
| 193-1207 | ||||||||||||||||||||||||
373 | flags |= 0x100; executed 1207 times by 1 test: flags |= 0x100; Executed by:
| 1207 | ||||||||||||||||||||||||
374 | - | |||||||||||||||||||||||||
375 | if (posixly_correct
| 0-1391 | ||||||||||||||||||||||||
376 | flags |= 0x010; executed 9 times by 1 test: flags |= 0x010; Executed by:
| 9 | ||||||||||||||||||||||||
377 | rval = _evalfile (filename, flags); | - | ||||||||||||||||||||||||
378 | - | |||||||||||||||||||||||||
379 | run_return_trap (); | - | ||||||||||||||||||||||||
380 | return executed 1386 times by 1 test: rval;return rval; Executed by:
executed 1386 times by 1 test: return rval; Executed by:
| 1386 | ||||||||||||||||||||||||
381 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |