Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | extern int executing_line_number (void); | - |
22 | | - |
23 | | - |
24 | extern pid_t shell_pgrp; | - |
25 | extern int give_terminal_to (pid_t, int); | - |
26 | | - |
27 | | - |
28 | | - |
29 | extern const char * const bash_badsub_errmsg; | - |
30 | | - |
31 | | - |
32 | static void error_prolog (int); | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | const char * const the_current_maintainer = "bash-maintainers@gnu.org"; | - |
41 | | - |
42 | int gnu_error_format = 0; | - |
43 | | - |
44 | static void | - |
45 | error_prolog (print_lineno) | - |
46 | int print_lineno; | - |
47 | { | - |
48 | char *ename; | - |
49 | int line; | - |
50 | | - |
51 | ename = get_name_for_error (); | - |
52 | line = (print_linenoTRUE | evaluated 1158 times by 1 test | FALSE | evaluated 3 times by 1 test |
&& interactive_shell == 0TRUE | evaluated 1156 times by 1 test | FALSE | evaluated 2 times by 1 test |
) ? executing_line_number () : -1; | 2-1158 |
53 | | - |
54 | if (line > 0TRUE | evaluated 1081 times by 1 test | FALSE | evaluated 80 times by 1 test |
) | 80-1081 |
55 | fprintf (executed 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
56 | stderrexecuted 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
57 | , "%s:%s%d: ", ename, gnu_error_format ? "" : executed 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
58 | dcgettext (((void *)0), executed 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
59 | " line "executed 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
60 | , 5)executed 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
61 | , line);executed 1081 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , line); | 1081 |
62 | else | - |
63 | fprintf (executed 80 times by 1 test: fprintf ( stderr , "%s: ", ename); | 80 |
64 | stderrexecuted 80 times by 1 test: fprintf ( stderr , "%s: ", ename); | 80 |
65 | , "%s: ", ename);executed 80 times by 1 test: fprintf ( stderr , "%s: ", ename); | 80 |
66 | } | - |
67 | | - |
68 | | - |
69 | char * | - |
70 | get_name_for_error () | - |
71 | { | - |
72 | char *name; | - |
73 | | - |
74 | SHELL_VAR *bash_source_v; | - |
75 | ARRAY *bash_source_a; | - |
76 | | - |
77 | | - |
78 | name = (char *) | - |
79 | ((void *)0) | - |
80 | ; | - |
81 | if (interactive_shell == 0TRUE | evaluated 1968 times by 1 test | FALSE | evaluated 5 times by 1 test |
) | 5-1968 |
82 | { | - |
83 | | - |
84 | bash_source_v = find_variable ("BASH_SOURCE"); | - |
85 | if (bash_source_vTRUE | evaluated 1935 times by 1 test | FALSE | evaluated 33 times by 1 test |
&& ((((TRUE | evaluated 1935 times by 1 test | FALSE | never evaluated |
bash_source_v)->attributes) & (0x0000004)))TRUE | evaluated 1935 times by 1 test | FALSE | never evaluated |
&& | 0-1935 |
86 | (TRUE | evaluated 1935 times by 1 test | FALSE | never evaluated |
bash_source_a = (ARRAY *)((bash_source_v)->value))TRUE | evaluated 1935 times by 1 test | FALSE | never evaluated |
) | 0-1935 |
87 | name = array_reference (bash_source_a, 0);executed 1935 times by 1 test: name = array_reference (bash_source_a, 0); | 1935 |
88 | if (name == 0TRUE | evaluated 100 times by 1 test | FALSE | evaluated 1868 times by 1 test |
|| *TRUE | never evaluated | FALSE | evaluated 1868 times by 1 test |
name == '\0'TRUE | never evaluated | FALSE | evaluated 1868 times by 1 test |
) | 0-1868 |
89 | | - |
90 | name = dollar_vars[0];executed 100 times by 1 test: name = dollar_vars[0]; | 100 |
91 | }executed 1968 times by 1 test: end of block | 1968 |
92 | if (name == 0TRUE | evaluated 5 times by 1 test | FALSE | evaluated 1968 times by 1 test |
&& shell_nameTRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
&& *TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
shell_nameTRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
) | 0-1968 |
93 | name = base_pathname (shell_name);executed 5 times by 1 test: name = base_pathname (shell_name); | 5 |
94 | if (name == 0TRUE | never evaluated | FALSE | evaluated 1973 times by 1 test |
) | 0-1973 |
95 | | - |
96 | name = "bash"; never executed: name = "bash"; | 0 |
97 | | - |
98 | | - |
99 | | - |
100 | | - |
101 | returnexecuted 1973 times by 1 test: return (name); (name);executed 1973 times by 1 test: return (name); | 1973 |
102 | } | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | void | - |
108 | file_error (filename) | - |
109 | const char *filename; | - |
110 | { | - |
111 | report_error ("%s: %s", filename, strerror ( | - |
112 | (*__errno_location ()) | - |
113 | )); | - |
114 | }executed 11 times by 1 test: end of block | 11 |
115 | | - |
116 | void | - |
117 | | - |
118 | programming_error (const char *format, ...) | - |
119 | | - |
120 | | - |
121 | | - |
122 | | - |
123 | | - |
124 | { | - |
125 | va_list args; | - |
126 | char *h; | - |
127 | | - |
128 | | - |
129 | give_terminal_to (shell_pgrp, 0); | - |
130 | | - |
131 | | - |
132 | | - |
133 | __builtin_va_start( | - |
134 | args | - |
135 | , | - |
136 | format | - |
137 | ) | - |
138 | ; | - |
139 | | - |
140 | vfprintf ( | - |
141 | stderr | - |
142 | , format, args); | - |
143 | fprintf ( | - |
144 | stderr | - |
145 | , "\n"); | - |
146 | | - |
147 | __builtin_va_end( | - |
148 | args | - |
149 | ) | - |
150 | ; | - |
151 | | - |
152 | | - |
153 | if (remember_on_historyTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
154 | { | - |
155 | h = last_history_line (); | - |
156 | fprintf ( | - |
157 | stderr | - |
158 | , | - |
159 | dcgettext (((void *)0), | - |
160 | "last command: %s\n" | - |
161 | , 5) | - |
162 | , h ? h : "(null)"); | - |
163 | } never executed: end of block | 0 |
164 | | - |
165 | | - |
166 | | - |
167 | | - |
168 | | - |
169 | | - |
170 | fprintf ( | - |
171 | stderr | - |
172 | , | - |
173 | dcgettext (((void *)0), | - |
174 | "Aborting..." | - |
175 | , 5) | - |
176 | ); | - |
177 | fflush ( | - |
178 | stderr | - |
179 | ); | - |
180 | | - |
181 | abort (); never executed: abort (); | 0 |
182 | } | - |
183 | | - |
184 | | - |
185 | | - |
186 | | - |
187 | | - |
188 | void | - |
189 | | - |
190 | report_error (const char *format, ...) | - |
191 | | - |
192 | | - |
193 | | - |
194 | | - |
195 | | - |
196 | { | - |
197 | va_list args; | - |
198 | | - |
199 | error_prolog (1); | - |
200 | | - |
201 | | - |
202 | __builtin_va_start( | - |
203 | args | - |
204 | , | - |
205 | format | - |
206 | ) | - |
207 | ; | - |
208 | | - |
209 | vfprintf ( | - |
210 | stderr | - |
211 | , format, args); | - |
212 | fprintf ( | - |
213 | stderr | - |
214 | , "\n"); | - |
215 | | - |
216 | | - |
217 | __builtin_va_end( | - |
218 | args | - |
219 | ) | - |
220 | ; | - |
221 | if (exit_immediately_on_errorTRUE | evaluated 1 time by 1 test | FALSE | evaluated 335 times by 1 test |
) | 1-335 |
222 | { | - |
223 | if (last_command_exit_value == 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
224 | last_command_exit_value = 1; never executed: last_command_exit_value = 1; | 0 |
225 | exit_shell (last_command_exit_value); | - |
226 | } never executed: end of block | 0 |
227 | }executed 335 times by 1 test: end of block | 335 |
228 | | - |
229 | void | - |
230 | | - |
231 | fatal_error (const char *format, ...) | - |
232 | | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | { | - |
238 | va_list args; | - |
239 | | - |
240 | error_prolog (0); | - |
241 | | - |
242 | | - |
243 | __builtin_va_start( | - |
244 | args | - |
245 | , | - |
246 | format | - |
247 | ) | - |
248 | ; | - |
249 | | - |
250 | vfprintf ( | - |
251 | stderr | - |
252 | , format, args); | - |
253 | fprintf ( | - |
254 | stderr | - |
255 | , "\n"); | - |
256 | | - |
257 | | - |
258 | __builtin_va_end( | - |
259 | args | - |
260 | ) | - |
261 | ; | - |
262 | sh_exit (2); | - |
263 | } never executed: end of block | 0 |
264 | | - |
265 | void | - |
266 | | - |
267 | internal_error (const char *format, ...) | - |
268 | | - |
269 | | - |
270 | | - |
271 | | - |
272 | | - |
273 | { | - |
274 | va_list args; | - |
275 | | - |
276 | error_prolog (1); | - |
277 | | - |
278 | | - |
279 | __builtin_va_start( | - |
280 | args | - |
281 | , | - |
282 | format | - |
283 | ) | - |
284 | ; | - |
285 | | - |
286 | vfprintf ( | - |
287 | stderr | - |
288 | , format, args); | - |
289 | fprintf ( | - |
290 | stderr | - |
291 | , "\n"); | - |
292 | | - |
293 | | - |
294 | __builtin_va_end( | - |
295 | args | - |
296 | ) | - |
297 | ; | - |
298 | }executed 381 times by 1 test: end of block | 381 |
299 | | - |
300 | void | - |
301 | | - |
302 | internal_warning (const char *format, ...) | - |
303 | | - |
304 | | - |
305 | | - |
306 | | - |
307 | | - |
308 | { | - |
309 | va_list args; | - |
310 | | - |
311 | error_prolog (1); | - |
312 | fprintf ( | - |
313 | stderr | - |
314 | , | - |
315 | dcgettext (((void *)0), | - |
316 | "warning: " | - |
317 | , 5) | - |
318 | ); | - |
319 | | - |
320 | | - |
321 | __builtin_va_start( | - |
322 | args | - |
323 | , | - |
324 | format | - |
325 | ) | - |
326 | ; | - |
327 | | - |
328 | vfprintf ( | - |
329 | stderr | - |
330 | , format, args); | - |
331 | fprintf ( | - |
332 | stderr | - |
333 | , "\n"); | - |
334 | | - |
335 | | - |
336 | __builtin_va_end( | - |
337 | args | - |
338 | ) | - |
339 | ; | - |
340 | }executed 439 times by 1 test: end of block | 439 |
341 | | - |
342 | void | - |
343 | | - |
344 | internal_inform (const char *format, ...) | - |
345 | | - |
346 | | - |
347 | | - |
348 | | - |
349 | | - |
350 | { | - |
351 | va_list args; | - |
352 | | - |
353 | error_prolog (1); | - |
354 | | - |
355 | fprintf ( | - |
356 | stderr | - |
357 | , | - |
358 | dcgettext (((void *)0), | - |
359 | "INFORM: " | - |
360 | , 5) | - |
361 | ); | - |
362 | | - |
363 | | - |
364 | __builtin_va_start( | - |
365 | args | - |
366 | , | - |
367 | format | - |
368 | ) | - |
369 | ; | - |
370 | | - |
371 | vfprintf ( | - |
372 | stderr | - |
373 | , format, args); | - |
374 | fprintf ( | - |
375 | stderr | - |
376 | , "\n"); | - |
377 | | - |
378 | | - |
379 | __builtin_va_end( | - |
380 | args | - |
381 | ) | - |
382 | ; | - |
383 | }executed 2 times by 1 test: end of block | 2 |
384 | | - |
385 | void | - |
386 | | - |
387 | sys_error (const char *format, ...) | - |
388 | | - |
389 | | - |
390 | | - |
391 | | - |
392 | | - |
393 | { | - |
394 | int e; | - |
395 | va_list args; | - |
396 | | - |
397 | e = | - |
398 | (*__errno_location ()) | - |
399 | ; | - |
400 | error_prolog (0); | - |
401 | | - |
402 | | - |
403 | __builtin_va_start( | - |
404 | args | - |
405 | , | - |
406 | format | - |
407 | ) | - |
408 | ; | - |
409 | | - |
410 | vfprintf ( | - |
411 | stderr | - |
412 | , format, args); | - |
413 | fprintf ( | - |
414 | stderr | - |
415 | , ": %s\n", strerror (e)); | - |
416 | | - |
417 | | - |
418 | __builtin_va_end( | - |
419 | args | - |
420 | ) | - |
421 | ; | - |
422 | }executed 3 times by 1 test: end of block | 3 |
423 | void | - |
424 | | - |
425 | parser_error (int lineno, const char *format, ...) | - |
426 | | - |
427 | | - |
428 | | - |
429 | | - |
430 | | - |
431 | | - |
432 | { | - |
433 | va_list args; | - |
434 | char *ename, *iname; | - |
435 | | - |
436 | ename = get_name_for_error (); | - |
437 | iname = yy_input_name (); | - |
438 | | - |
439 | if (interactiveTRUE | never evaluated | FALSE | evaluated 91 times by 1 test |
) | 0-91 |
440 | fprintf ( never executed: fprintf ( stderr , "%s: ", ename); | 0 |
441 | stderr never executed: fprintf ( stderr , "%s: ", ename); | 0 |
442 | , "%s: ", ename); never executed: fprintf ( stderr , "%s: ", ename); | 0 |
443 | else if (interactive_shellTRUE | never evaluated | FALSE | evaluated 91 times by 1 test |
) | 0-91 |
444 | fprintf ( never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
445 | stderr never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
446 | , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
447 | dcgettext (((void *)0), never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
448 | " line " never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
449 | , 5) never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
450 | , lineno); never executed: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 0 |
451 | else if (((TRUE | evaluated 46 times by 1 test | FALSE | evaluated 45 times by 1 test |
ename)[0] == (iname)[0]TRUE | evaluated 46 times by 1 test | FALSE | evaluated 45 times by 1 test |
&& | 45-46 |
452 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
453 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
454 | ) && __builtin_constant_p (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
455 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
456 | ) && (__s1_len = __builtin_strlen (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
457 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
458 | ), __s2_len = __builtin_strlen (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
459 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
460 | ), (!((size_t)(const void *)((TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
461 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
462 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
463 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
464 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
465 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
466 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
467 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
468 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
469 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
470 | , TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
471 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
472 | ) : (__builtin_constant_p (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
473 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
474 | ) && ((size_t)(const void *)((TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
475 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
476 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
477 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
478 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
479 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
480 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
481 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
482 | ) && ((size_t)(const void *)((TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
483 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
484 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
485 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
486 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
487 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
488 | , TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
489 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
490 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
491 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
492 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
493 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
494 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
495 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
496 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
497 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
498 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( ename ))[3] - __s2[3]); TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
499 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( ename ))[3] - __s2[3]); | 0-46 |
500 | ))[3] - __s2[3]);TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( ename ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
501 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
502 | ) && ((size_t)(const void *)((TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
503 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
504 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
505 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
506 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
507 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
508 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
509 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
510 | ) && ((size_t)(const void *)((TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
511 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
512 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
513 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
514 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
515 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
516 | , TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
517 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
518 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
519 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
520 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
521 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
522 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
523 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
524 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
525 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
526 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( iname ))[3] - __s2[3]); TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
527 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( iname ))[3] - __s2[3]); | 0-46 |
528 | ))[3] - __s2[3]);TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( iname ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
529 | enameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
530 | , TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
531 | inameTRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
532 | )))); }) TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
| 0-46 |
533 | == 0TRUE | evaluated 46 times by 1 test | FALSE | never evaluated |
)) | 0-46 |
534 | fprintf (executed 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
535 | stderrexecuted 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
536 | , "%s:%s%d: ", ename, gnu_error_format ? "" : executed 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
537 | dcgettext (((void *)0), executed 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
538 | " line "executed 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
539 | , 5)executed 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
540 | , lineno);executed 46 times by 1 test: fprintf ( stderr , "%s:%s%d: ", ename, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 46 |
541 | else | - |
542 | fprintf (executed 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
543 | stderrexecuted 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
544 | , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : executed 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
545 | dcgettext (((void *)0), executed 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
546 | " line "executed 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
547 | , 5)executed 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
548 | , lineno);executed 45 times by 1 test: fprintf ( stderr , "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : dcgettext (((void *)0), " line " , 5) , lineno); | 45 |
549 | | - |
550 | | - |
551 | __builtin_va_start( | - |
552 | args | - |
553 | , | - |
554 | format | - |
555 | ) | - |
556 | ; | - |
557 | | - |
558 | vfprintf ( | - |
559 | stderr | - |
560 | , format, args); | - |
561 | fprintf ( | - |
562 | stderr | - |
563 | , "\n"); | - |
564 | | - |
565 | | - |
566 | __builtin_va_end( | - |
567 | args | - |
568 | ) | - |
569 | ; | - |
570 | | - |
571 | if (exit_immediately_on_errorTRUE | never evaluated | FALSE | evaluated 91 times by 1 test |
) | 0-91 |
572 | exit_shell (last_command_exit_value = 2); never executed: exit_shell (last_command_exit_value = 2); | 0 |
573 | }executed 91 times by 1 test: end of block | 91 |
574 | | - |
575 | | - |
576 | | - |
577 | char * | - |
578 | strescape (str) | - |
579 | const char *str; | - |
580 | { | - |
581 | char *r, *result; | - |
582 | unsigned char *s; | - |
583 | | - |
584 | r = result = (char *)sh_xmalloc((strlen (str) * 2 + 1), "error.c", 373); | - |
585 | | - |
586 | for (s = (unsigned char *)str; sTRUE | never evaluated | FALSE | never evaluated |
&& *TRUE | never evaluated | FALSE | never evaluated |
sTRUE | never evaluated | FALSE | never evaluated |
; s++) | 0 |
587 | { | - |
588 | if (*TRUE | never evaluated | FALSE | never evaluated |
s < ' 'TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
589 | { | - |
590 | *r++ = '^'; | - |
591 | *r++ = *s+64; | - |
592 | } never executed: end of block | 0 |
593 | else if (*TRUE | never evaluated | FALSE | never evaluated |
s == 127TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
594 | { | - |
595 | *r++ = '^'; | - |
596 | *r++ = '?'; | - |
597 | } never executed: end of block | 0 |
598 | else | - |
599 | * never executed: *r++ = *s; r++ = *s;never executed: *r++ = *s; | 0 |
600 | } | - |
601 | | - |
602 | *r = '\0'; | - |
603 | return never executed: return result; result;never executed: return result; | 0 |
604 | } | - |
605 | | - |
606 | void | - |
607 | | - |
608 | itrace (const char *format, ...) | - |
609 | | - |
610 | | - |
611 | | - |
612 | | - |
613 | | - |
614 | { | - |
615 | va_list args; | - |
616 | | - |
617 | fprintf( | - |
618 | stderr | - |
619 | , "TRACE: pid %ld: ", (long)getpid()); | - |
620 | | - |
621 | | - |
622 | __builtin_va_start( | - |
623 | args | - |
624 | , | - |
625 | format | - |
626 | ) | - |
627 | ; | - |
628 | | - |
629 | vfprintf ( | - |
630 | stderr | - |
631 | , format, args); | - |
632 | fprintf ( | - |
633 | stderr | - |
634 | , "\n"); | - |
635 | | - |
636 | | - |
637 | __builtin_va_end( | - |
638 | args | - |
639 | ) | - |
640 | ; | - |
641 | | - |
642 | fflush( | - |
643 | stderr | - |
644 | ); | - |
645 | } never executed: end of block | 0 |
646 | | - |
647 | | - |
648 | | - |
649 | void | - |
650 | | - |
651 | trace (const char *format, ...) | - |
652 | | - |
653 | | - |
654 | | - |
655 | | - |
656 | | - |
657 | { | - |
658 | va_list args; | - |
659 | static FILE *tracefp = (FILE *) | - |
660 | ((void *)0) | - |
661 | ; | - |
662 | | - |
663 | if (tracefp == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
664 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
665 | ) | - |
666 | tracefp = fopen("/tmp/bash-trace.log", "a+"); never executed: tracefp = fopen("/tmp/bash-trace.log", "a+"); | 0 |
667 | | - |
668 | if (tracefp == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
669 | ((void *)0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
670 | ) | - |
671 | tracefp = never executed: tracefp = stderr ; | 0 |
672 | stderr never executed: tracefp = stderr ; | 0 |
673 | ; never executed: tracefp = stderr ; | 0 |
674 | else | - |
675 | fcntl (fileno (tracefp), never executed: fcntl (fileno (tracefp), 2 , 1); | 0 |
676 | 2 never executed: fcntl (fileno (tracefp), 2 , 1); | 0 |
677 | , 1); never executed: fcntl (fileno (tracefp), 2 , 1); | 0 |
678 | | - |
679 | fprintf(tracefp, "TRACE: pid %ld: ", (long)getpid()); | - |
680 | | - |
681 | | - |
682 | __builtin_va_start( | - |
683 | args | - |
684 | , | - |
685 | format | - |
686 | ) | - |
687 | ; | - |
688 | | - |
689 | vfprintf (tracefp, format, args); | - |
690 | fprintf (tracefp, "\n"); | - |
691 | | - |
692 | | - |
693 | __builtin_va_end( | - |
694 | args | - |
695 | ) | - |
696 | ; | - |
697 | | - |
698 | fflush(tracefp); | - |
699 | } never executed: end of block | 0 |
700 | static const char * const cmd_error_table[] = { | - |
701 | "unknown command error", | - |
702 | "bad command type", | - |
703 | "bad connector", | - |
704 | "bad jump", | - |
705 | 0 | - |
706 | }; | - |
707 | | - |
708 | void | - |
709 | command_error (func, code, e, flags) | - |
710 | const char *func; | - |
711 | int code, e, flags; | - |
712 | { | - |
713 | if (code > 3TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
714 | code = 0; never executed: code = 0; | 0 |
715 | | - |
716 | programming_error ("%s: %s: %d", func, | - |
717 | dcgettext (((void *)0), | - |
718 | cmd_error_table[code] | - |
719 | , 5) | - |
720 | , e); | - |
721 | } never executed: end of block | 0 |
722 | | - |
723 | char * | - |
724 | command_errstr (code) | - |
725 | int code; | - |
726 | { | - |
727 | if (code > 3TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
728 | code = 0; never executed: code = 0; | 0 |
729 | | - |
730 | return never executed: return ( dcgettext (((void *)0), cmd_error_table[code] , 5) ); (never executed: return ( dcgettext (((void *)0), cmd_error_table[code] , 5) ); | 0 |
731 | dcgettext (((void *)0), never executed: return ( dcgettext (((void *)0), cmd_error_table[code] , 5) ); | 0 |
732 | cmd_error_table[code] never executed: return ( dcgettext (((void *)0), cmd_error_table[code] , 5) ); | 0 |
733 | , 5) never executed: return ( dcgettext (((void *)0), cmd_error_table[code] , 5) ); | 0 |
734 | ); never executed: return ( dcgettext (((void *)0), cmd_error_table[code] , 5) ); | 0 |
735 | } | - |
736 | | - |
737 | | - |
738 | void | - |
739 | err_badarraysub (s) | - |
740 | const char *s; | - |
741 | { | - |
742 | report_error ("%s: %s", s, | - |
743 | dcgettext (((void *)0), | - |
744 | bash_badsub_errmsg | - |
745 | , 5) | - |
746 | ); | - |
747 | }executed 67 times by 1 test: end of block | 67 |
748 | | - |
749 | | - |
750 | void | - |
751 | err_unboundvar (s) | - |
752 | const char *s; | - |
753 | { | - |
754 | report_error ( | - |
755 | dcgettext (((void *)0), | - |
756 | "%s: unbound variable" | - |
757 | , 5) | - |
758 | , s); | - |
759 | }executed 34 times by 1 test: end of block | 34 |
760 | | - |
761 | void | - |
762 | err_readonly (s) | - |
763 | const char *s; | - |
764 | { | - |
765 | report_error ( | - |
766 | dcgettext (((void *)0), | - |
767 | "%s: readonly variable" | - |
768 | , 5) | - |
769 | , s); | - |
770 | }executed 82 times by 1 test: end of block | 82 |
| | |