OpenCoverage

evalfile.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/evalfile.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14int sourcelevel = 0;-
15-
16static 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
fd < 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1402 times by 1 test
Evaluated by:
  • Self test
|| (
(fstat (fd, &finfo) == -1)Description
TRUEnever evaluated
FALSEevaluated 1402 times by 1 test
Evaluated by:
  • Self test
fstat (fd, &finfo) == -1)
(fstat (fd, &finfo) == -1)Description
TRUEnever evaluated
FALSEevaluated 1402 times by 1 test
Evaluated by:
  • Self test
)
0-1402
57 {-
58 i = -
59 (*__errno_location ())-
60 ;-
61 if (fd >= 0
fd >= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
0-3
62 close (fd);
never executed: close (fd);
0
63 -
64 (*__errno_location ()) -
65 = i;-
66-
67file_error_and_exit:
code before this statement executed 3 times by 1 test: file_error_and_exit:
Executed by:
  • Self test
3
68 if (((
((flags & 0x001) == 0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x001) == 0)
((flags & 0x001) == 0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
||
0-3
69 (*
(*__errno_location ()) != 2Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) != 2Description
TRUEnever evaluated
FALSEnever evaluated
0
70 !=
(*__errno_location ()) != 2Description
TRUEnever evaluated
FALSEnever evaluated
0
71 2
(*__errno_location ()) != 2Description
TRUEnever evaluated
FALSEnever evaluated
0
72 )-
73 file_error (filename);
executed 3 times by 1 test: file_error (filename);
Executed by:
  • Self test
3
74-
75 if (flags & 0x010
flags & 0x010Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
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: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1));
Executed by:
  • Self test
((flags & 0x002) ? 1
executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1));
Executed by:
  • Self test
2
82 : ((
executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1));
Executed by:
  • Self test
2
83 (*__errno_location ())
executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1));
Executed by:
  • Self test
2
84 ==
executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1));
Executed by:
  • Self test
2
85 2
executed 2 times by 1 test: return ((flags & 0x002) ? 1 : (( (*__errno_location ()) == 2 && (flags & 0x001) != 0) ? 0 : -1));
Executed by:
  • Self test
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:
  • Self test
2
87 }-
88-
89 errfunc = ((
(flags & 0x002)Description
TRUEevaluated 1399 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
flags & 0x002)
(flags & 0x002)Description
TRUEevaluated 1399 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
? builtin_error : internal_error);
3-1399
90-
91 if (-
92 ((((
(((( finfo.st_... == (0040000))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1393 times by 1 test
Evaluated by:
  • Self test
9-1393
93 finfo.st_mode
(((( finfo.st_... == (0040000))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1393 times by 1 test
Evaluated by:
  • Self test
9-1393
94 )) & 0170000) == (0040000))
(((( finfo.st_... == (0040000))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1393 times by 1 test
Evaluated by:
  • Self test
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: return ((flags & 0x002) ? 1 : -1);
Executed by:
  • Self test
((flags & 0x002) ? 1 : -1);
executed 9 times by 1 test: return ((flags & 0x002) ? 1 : -1);
Executed by:
  • Self test
9
104 }-
105 else if ((
(flags & 0x080)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1391 times by 1 test
Evaluated by:
  • Self test
flags & 0x080)
(flags & 0x080)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1391 times by 1 test
Evaluated by:
  • Self test
&&
2-1391
106 ((((
(((( finfo.st_...0100000)) == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-2
107 finfo.st_mode
(((( finfo.st_...0100000)) == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-2
108 )) & 0170000) == (0100000))
(((( finfo.st_...0100000)) == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
0-2
109 == 0
(((( finfo.st_...0100000)) == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
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: return ((flags & 0x002) ? 1 : -1);
((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
file_size != finfo.st_sizeDescription
TRUEnever evaluated
FALSEevaluated 1393 times by 1 test
Evaluated by:
  • Self test
|| file_size + 1 < file_size
file_size + 1 < file_sizeDescription
TRUEnever evaluated
FALSEevaluated 1393 times by 1 test
Evaluated by:
  • Self test
)
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: return ((flags & 0x002) ? 1 : -1);
((flags & 0x002) ? 1 : -1);
never executed: return ((flags & 0x002) ? 1 : -1);
0
131 }-
132-
133 if (-
134 ((((
(((( finfo.st_... == (0100000))Description
TRUEevaluated 1373 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20 times by 1 test
Evaluated by:
  • Self test
20-1373
135 finfo.st_mode
(((( finfo.st_... == (0100000))Description
TRUEevaluated 1373 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20 times by 1 test
Evaluated by:
  • Self test
20-1373
136 )) & 0170000) == (0100000))
(((( finfo.st_... == (0100000))Description
TRUEevaluated 1373 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 20 times by 1 test
Evaluated by:
  • Self test
20-1373
137 && file_size <= 0x7fffffffffffffffL
file_size <= 0...fffffffffffffLDescription
TRUEevaluated 1373 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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
nr >= 0Description
TRUEevaluated 1373 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-1373
142 string[nr] = '\0';
executed 1373 times by 1 test: string[nr] = '\0';
Executed by:
  • Self test
1373
143 }
executed 1373 times by 1 test: end of block
Executed by:
  • Self test
1373
144 else-
145 nr = zmapfd (fd, &string, 0);
executed 20 times by 1 test: nr = zmapfd (fd, &string, 0);
Executed by:
  • Self test
20
146-
147 return_val = -
148 (*__errno_location ())-
149 ;-
150 close (fd);-
151 -
152 (*__errno_location ()) -
153 = return_val;-
154-
155 if (nr < 0
nr < 0Description
TRUEnever evaluated
FALSEevaluated 1393 times by 1 test
Evaluated by:
  • Self test
)
0-1393
156 {-
157 sh_xfree((string), "evalfile.c", 174);-
158 goto
never executed: goto file_error_and_exit;
file_error_and_exit;
never executed: goto file_error_and_exit;
0
159 }-
160-
161 if (nr == 0
nr == 0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1372 times by 1 test
Evaluated by:
  • Self test
)
21-1372
162 {-
163 sh_xfree((string), "evalfile.c", 180);-
164 return
executed 21 times by 1 test: return ((flags & 0x002) ? 0 : 1);
Executed by:
  • Self test
((flags & 0x002) ? 0 : 1);
executed 21 times by 1 test: return ((flags & 0x002) ? 0 : 1);
Executed by:
  • Self test
21
165 }-
166-
167 if ((
(flags & 0x040)Description
TRUEnever evaluated
FALSEevaluated 1372 times by 1 test
Evaluated by:
  • Self test
flags & 0x040)
(flags & 0x040)Description
TRUEnever evaluated
FALSEevaluated 1372 times by 1 test
Evaluated by:
  • Self test
&&
0-1372
168 check_binary_file (string, (nr > 80) ? 80 : nr)
check_binary_f...80) ? 80 : nr)Description
TRUEnever evaluated
FALSEnever evaluated
)
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: return ((flags & 0x002) ? 126 : -1);
((flags & 0x002) ? 126 : -1);
never executed: return ((flags & 0x002) ? 126 : -1);
0
177 }-
178-
179 i = strlen (string);-
180 if (i < nr
i < nrDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1363 times by 1 test
Evaluated by:
  • Self test
)
9-1363
181 {-
182 for (nnull = i = 0; i < nr
i < nrDescription
TRUEevaluated 3276 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
; i++)
0-3276
183 if (string[i] == '\0'
string[i] == '\0'Description
TRUEevaluated 2313 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 963 times by 1 test
Evaluated by:
  • Self test
)
963-2313
184 {-
185 memmove (string+i, string+i+1, nr - i);-
186 nr--;-
187-
188-
189-
190 if ((
(flags & 0x002)Description
TRUEevaluated 2313 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x002)
(flags & 0x002)Description
TRUEevaluated 2313 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ++
++nnull > 256Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2304 times by 1 test
Evaluated by:
  • Self test
nnull > 256
++nnull > 256Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2304 times by 1 test
Evaluated by:
  • Self test
)
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: return ((flags & 0x002) ? 126 : -1);
Executed by:
  • Self test
((flags & 0x002) ? 126 : -1);
executed 9 times by 1 test: return ((flags & 0x002) ? 126 : -1);
Executed by:
  • Self test
9
199 }-
200 }
executed 2304 times by 1 test: end of block
Executed by:
  • Self test
2304
201 }
never executed: end of block
0
202-
203 if (flags & 0x004
flags & 0x004Description
TRUEevaluated 1358 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
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
flags & 0x008Description
TRUEevaluated 1358 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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:
  • Self test
1358
211 unwind_protect_mem ((char *)&(sourcelevel), sizeof (sourcelevel));-
212 }
executed 1358 times by 1 test: end of block
Executed by:
  • Self test
1358
213 else-
214 {-
215 xbcopy ((char *)return_catch, (char *)old_return_catch, sizeof (sigjmp_buf));;-
216 if (flags & 0x008
flags & 0x008Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
2-3
217 old_interactive = interactive;
executed 3 times by 1 test: old_interactive = interactive;
Executed by:
  • Self test
3
218 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test
5
219-
220 if (flags & 0x008
flags & 0x008Description
TRUEevaluated 1361 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
2-1361
221 interactive = 0;
executed 1361 times by 1 test: interactive = 0;
Executed by:
  • Self test
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
flags & 0x004Description
TRUEevaluated 1358 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
1358
242-
243-
244-
245-
246 if ((
(flags & 0x100) == 0Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1207 times by 1 test
Evaluated by:
  • Self test
flags & 0x100) == 0
(flags & 0x100) == 0Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1207 times by 1 test
Evaluated by:
  • Self test
)
156-1207
247 {-
248 if (shell_compatibility_level <= 44
shell_compatib...ty_level <= 44Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • Self test
)
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
flags & 0x004Description
TRUEevaluated 151 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
5-151
254 add_unwind_protect (pop_args, 0);
executed 151 times by 1 test: add_unwind_protect (pop_args, 0);
Executed by:
  • Self test
151
255 }
executed 156 times by 1 test: end of block
Executed by:
  • Self test
156
256-
257-
258-
259-
260 pflags = 0x010;-
261 pflags |= (
(flags & 0x020)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1361 times by 1 test
Evaluated by:
  • Self test
flags & 0x020)
(flags & 0x020)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1361 times by 1 test
Evaluated by:
  • Self test
? 0 : 0x004;
2-1361
262-
263 if (flags & 0x002
flags & 0x002Description
TRUEevaluated 1360 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
3-1360
264 result = 0;
executed 1360 times by 1 test: result = 0;
Executed by:
  • Self test
1360
265-
266 return_val = -
267 __sigsetjmp (-
268 (return_catch)-
269 , -
270 0-
271 )-
272 ;-
273-
274-
275-
276 if (return_val
return_valDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1363 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
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:
  • Self test
1363
283-
284 if (flags & 0x004
flags & 0x004Description
TRUEevaluated 1345 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
)
4-1345
285 run_unwind_frame ("_evalfile");
executed 1345 times by 1 test: run_unwind_frame ("_evalfile");
Executed by:
  • Self test
1345
286 else-
287 {-
288 if (flags & 0x008
flags & 0x008Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
2
289 interactive = old_interactive;
executed 2 times by 1 test: interactive = old_interactive;
Executed by:
  • Self test
2
290-
291 restore_funcarray_state (fa);-
292-
293 if ((
(flags & 0x100) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x100) == 0
(flags & 0x100) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
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:
  • Self test
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:
  • Self test
4
306-
307-
308-
309 if (current_token == 304
current_token == 304Description
TRUEnever evaluated
FALSEevaluated 1349 times by 1 test
Evaluated by:
  • Self test
)
0-1349
310 push_token ('\n');
never executed: push_token ('\n');
0
311-
312 return
executed 1349 times by 1 test: return ((flags & 0x002) ? result : 1);
Executed by:
  • Self test
((flags & 0x002) ? result : 1);
executed 1349 times by 1 test: return ((flags & 0x002) ? result : 1);
Executed by:
  • Self test
1349
313}-
314-
315int-
316maybe_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
force_noninteractiveDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-3
326 flags |= 0x008;
executed 3 times by 1 test: flags |= 0x008;
Executed by:
  • Self test
3
327 result = _evalfile (filename, flags);-
328 sh_xfree((filename), "evalfile.c", 331);-
329 return
executed 2 times by 1 test: return result;
Executed by:
  • Self test
result;
executed 2 times by 1 test: return result;
Executed by:
  • Self test
2
330}-
331-
332int-
333force_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
force_noninteractiveDescription
TRUEnever evaluated
FALSEnever evaluated
)
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: return result;
result;
never executed: return result;
0
347}-
348-
349-
350int-
351fc_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: return (_evalfile (filename, flags));
Executed by:
  • Self test
(_evalfile (filename, flags));
executed 2 times by 1 test: return (_evalfile (filename, flags));
Executed by:
  • Self test
2
361}-
362-
363-
364int-
365source_file (filename, sflags)-
366 const char *filename;-
367 int sflags;-
368{-
369 int flags, rval;-
370-
371 flags = 0x002|0x004|0x008;-
372 if (sflags
sflagsDescription
TRUEevaluated 1207 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 193 times by 1 test
Evaluated by:
  • Self test
)
193-1207
373 flags |= 0x100;
executed 1207 times by 1 test: flags |= 0x100;
Executed by:
  • Self test
1207
374-
375 if (posixly_correct
posixly_correctDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1391 times by 1 test
Evaluated by:
  • Self test
&& interactive_shell == 0
interactive_shell == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& executing_command_builtin == 0
executing_command_builtin == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-1391
376 flags |= 0x010;
executed 9 times by 1 test: flags |= 0x010;
Executed by:
  • Self test
9
377 rval = _evalfile (filename, flags);-
378-
379 run_return_trap ();-
380 return
executed 1386 times by 1 test: return rval;
Executed by:
  • Self test
rval;
executed 1386 times by 1 test: return rval;
Executed by:
  • Self test
1386
381}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2