OpenCoverage

command.def

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/command.def
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17int-
18command_builtin (list)-
19 WORD_LIST *list;-
20{-
21 int result, verbose, use_standard_path, opt;-
22 COMMAND *command;-
23-
24 verbose = use_standard_path = 0;-
25 reset_internal_getopt ();-
26 while ((
(opt = interna... "pvV")) != -1Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 111 times by 1 test
Evaluated by:
  • Self test
opt = internal_getopt (list, "pvV")) != -1
(opt = interna... "pvV")) != -1Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 111 times by 1 test
Evaluated by:
  • Self test
)
70-111
27 {-
28 switch (opt)-
29 {-
30 case
executed 35 times by 1 test: case 'p':
Executed by:
  • Self test
'p':
executed 35 times by 1 test: case 'p':
Executed by:
  • Self test
35
31 use_standard_path = 0x100;-
32 break;
executed 35 times by 1 test: break;
Executed by:
  • Self test
35
33 case
executed 10 times by 1 test: case 'V':
Executed by:
  • Self test
'V':
executed 10 times by 1 test: case 'V':
Executed by:
  • Self test
10
34 verbose = 0x002|0x080;-
35 break;
executed 10 times by 1 test: break;
Executed by:
  • Self test
10
36 case
executed 24 times by 1 test: case 'v':
Executed by:
  • Self test
'v':
executed 24 times by 1 test: case 'v':
Executed by:
  • Self test
24
37 verbose = 0x004;-
38 break;
executed 24 times by 1 test: break;
Executed by:
  • Self test
24
39 case
never executed: case -99:
-99:
never executed: case -99:
builtin_help (); return
never executed: return (258);
(258);
never executed: return (258);
0
40 default
executed 1 time by 1 test: default:
Executed by:
  • Self test
:
executed 1 time by 1 test: default:
Executed by:
  • Self test
1
41 builtin_usage ();-
42 return
executed 1 time by 1 test: return (258);
Executed by:
  • Self test
(258);
executed 1 time by 1 test: return (258);
Executed by:
  • Self test
1
43 }-
44 }-
45 list = loptend;-
46-
47 if (list == 0
list == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 102 times by 1 test
Evaluated by:
  • Self test
)
9-102
48 return
executed 9 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 9 times by 1 test: return (0);
Executed by:
  • Self test
9
49-
50-
51 if (use_standard_path
use_standard_pathDescription
TRUEevaluated 35 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 67 times by 1 test
Evaluated by:
  • Self test
&& restricted
restrictedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 34 times by 1 test
Evaluated by:
  • Self test
)
1-67
52 {-
53 sh_restricted ("-p");-
54 return
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
1
55 }-
56-
57-
58 if (verbose
verboseDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 67 times by 1 test
Evaluated by:
  • Self test
)
34-67
59 {-
60 int found, any_found;-
61-
62 for (any_found = 0; list
listDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 34 times by 1 test
Evaluated by:
  • Self test
; list = list->next)
34
63 {-
64 found = describe_command (list->word->word, verbose|use_standard_path);-
65-
66 if (found == 0
found == 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test
&& verbose != 0x004
verbose != 0x004Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
0-26
67 sh_notfound (list->word->word);
never executed: sh_notfound (list->word->word);
0
68-
69 any_found += found;-
70 }
executed 34 times by 1 test: end of block
Executed by:
  • Self test
34
71-
72 return
executed 34 times by 1 test: return (any_found ? 0 : 1);
Executed by:
  • Self test
(any_found ? 0 : 1);
executed 34 times by 1 test: return (any_found ? 0 : 1);
Executed by:
  • Self test
34
73 }-
74-
75 begin_unwind_frame ("command_builtin");-
76-
77-
78-
79-
80-
81 command = make_bare_simple_command ();-
82 command->value.Simple->words = (WORD_LIST *)copy_word_list (list);-
83 command->value.Simple->redirects = (REDIRECT *)-
84 ((void *)0)-
85 ;-
86 command->flags |= (0x10 | 0x20 | 0x0800 | (use_standard_path ? 0x4000 : 0));-
87 command->value.Simple->flags |= (0x10 | 0x20 | 0x0800 | (use_standard_path ? 0x4000 : 0));-
88-
89 add_unwind_protect ((char *)dispose_command, command);-
90 result = execute_command (command);-
91-
92 run_unwind_frame ("command_builtin");-
93-
94 return
executed 64 times by 1 test: return (result);
Executed by:
  • Self test
(result);
executed 64 times by 1 test: return (result);
Executed by:
  • Self test
64
95}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2