Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/copy_cmd.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | static PATTERN_LIST *copy_case_clause (PATTERN_LIST *); | - | ||||||
9 | static PATTERN_LIST *copy_case_clauses (PATTERN_LIST *); | - | ||||||
10 | static FOR_COM *copy_for_command (FOR_COM *); | - | ||||||
11 | - | |||||||
12 | static ARITH_FOR_COM *copy_arith_for_command (ARITH_FOR_COM *); | - | ||||||
13 | - | |||||||
14 | static GROUP_COM *copy_group_command (GROUP_COM *); | - | ||||||
15 | static SUBSHELL_COM *copy_subshell_command (SUBSHELL_COM *); | - | ||||||
16 | static COPROC_COM *copy_coproc_command (COPROC_COM *); | - | ||||||
17 | static CASE_COM *copy_case_command (CASE_COM *); | - | ||||||
18 | static WHILE_COM *copy_while_command (WHILE_COM *); | - | ||||||
19 | static IF_COM *copy_if_command (IF_COM *); | - | ||||||
20 | - | |||||||
21 | static ARITH_COM *copy_arith_command (ARITH_COM *); | - | ||||||
22 | - | |||||||
23 | - | |||||||
24 | static COND_COM *copy_cond_command (COND_COM *); | - | ||||||
25 | - | |||||||
26 | static SIMPLE_COM *copy_simple_command (SIMPLE_COM *); | - | ||||||
27 | - | |||||||
28 | WORD_DESC * | - | ||||||
29 | copy_word (w) | - | ||||||
30 | WORD_DESC *w; | - | ||||||
31 | { | - | ||||||
32 | WORD_DESC *new_word; | - | ||||||
33 | - | |||||||
34 | new_word = make_bare_word (w->word); | - | ||||||
35 | new_word->flags = w->flags; | - | ||||||
36 | return executed 319828941 times by 1 test: (new_word);return (new_word); Executed by:
executed 319828941 times by 1 test: return (new_word); Executed by:
| 319828941 | ||||||
37 | } | - | ||||||
38 | - | |||||||
39 | - | |||||||
40 | - | |||||||
41 | WORD_LIST * | - | ||||||
42 | copy_word_list (list) | - | ||||||
43 | WORD_LIST *list; | - | ||||||
44 | { | - | ||||||
45 | WORD_LIST *new_list, *tl; | - | ||||||
46 | - | |||||||
47 | for (new_list = tl = (WORD_LIST *) | - | ||||||
48 | ((void *)0) | - | ||||||
49 | ; list
| 232919229-285088166 | ||||||
50 | { | - | ||||||
51 | if (new_list == 0
| 58706599-226381567 | ||||||
52 | new_list = tl = make_word_list (copy_word (list->word), new_list); executed 226381567 times by 1 test: new_list = tl = make_word_list (copy_word (list->word), new_list); Executed by:
| 226381567 | ||||||
53 | else | - | ||||||
54 | { | - | ||||||
55 | tl->next = make_word_list (copy_word (list->word), (WORD_LIST *) | - | ||||||
56 | ((void *)0) | - | ||||||
57 | ); | - | ||||||
58 | tl = tl->next; | - | ||||||
59 | } executed 58706599 times by 1 test: end of block Executed by:
| 58706599 | ||||||
60 | } | - | ||||||
61 | - | |||||||
62 | return executed 232919229 times by 1 test: (new_list);return (new_list); Executed by:
executed 232919229 times by 1 test: return (new_list); Executed by:
| 232919229 | ||||||
63 | } | - | ||||||
64 | - | |||||||
65 | static PATTERN_LIST * | - | ||||||
66 | copy_case_clause (clause) | - | ||||||
67 | PATTERN_LIST *clause; | - | ||||||
68 | { | - | ||||||
69 | PATTERN_LIST *new_clause; | - | ||||||
70 | - | |||||||
71 | new_clause = (PATTERN_LIST *)sh_xmalloc((sizeof (PATTERN_LIST)), "copy_cmd.c", 94); | - | ||||||
72 | new_clause->patterns = copy_word_list (clause->patterns); | - | ||||||
73 | new_clause->action = copy_command (clause->action); | - | ||||||
74 | new_clause->flags = clause->flags; | - | ||||||
75 | return executed 79389514 times by 1 test: (new_clause);return (new_clause); Executed by:
executed 79389514 times by 1 test: return (new_clause); Executed by:
| 79389514 | ||||||
76 | } | - | ||||||
77 | - | |||||||
78 | static PATTERN_LIST * | - | ||||||
79 | copy_case_clauses (clauses) | - | ||||||
80 | PATTERN_LIST *clauses; | - | ||||||
81 | { | - | ||||||
82 | PATTERN_LIST *new_list, *new_clause; | - | ||||||
83 | - | |||||||
84 | for (new_list = (PATTERN_LIST *) | - | ||||||
85 | ((void *)0) | - | ||||||
86 | ; clauses
| 32402567-79389514 | ||||||
87 | { | - | ||||||
88 | new_clause = copy_case_clause (clauses); | - | ||||||
89 | new_clause->next = new_list; | - | ||||||
90 | new_list = new_clause; | - | ||||||
91 | } executed 79389514 times by 1 test: end of block Executed by:
| 79389514 | ||||||
92 | return executed 32402567 times by 1 test: (((new_list && new_list->next) ? (PATTERN_LIST *)list_reverse ((GENERIC_LIST *)new_list) : (PATTERN_LIST *)(new_list)));return (((new_list && new_list->next) ? (PATTERN_LIST *)list_reverse ((GENERIC_LIST *)new_list) : (PATTERN_LIST *)(new_list))); Executed by:
executed 32402567 times by 1 test: return (((new_list && new_list->next) ? (PATTERN_LIST *)list_reverse ((GENERIC_LIST *)new_list) : (PATTERN_LIST *)(new_list))); Executed by:
| 32402567 | ||||||
93 | } | - | ||||||
94 | - | |||||||
95 | - | |||||||
96 | REDIRECT * | - | ||||||
97 | copy_redirect (redirect) | - | ||||||
98 | REDIRECT *redirect; | - | ||||||
99 | { | - | ||||||
100 | REDIRECT *new_redirect; | - | ||||||
101 | - | |||||||
102 | new_redirect = (REDIRECT *)sh_xmalloc((sizeof (REDIRECT)), "copy_cmd.c", 123); | - | ||||||
103 | - | |||||||
104 | - | |||||||
105 | - | |||||||
106 | *new_redirect = *redirect; | - | ||||||
107 | - | |||||||
108 | - | |||||||
109 | if (redirect->rflags & 0x01
| 60-777072 | ||||||
110 | new_redirect->redirector.filename = copy_word (redirect->redirector.filename); executed 60 times by 1 test: new_redirect->redirector.filename = copy_word (redirect->redirector.filename); Executed by:
| 60 | ||||||
111 | - | |||||||
112 | switch (redirect->instruction) | - | ||||||
113 | { | - | ||||||
114 | case executed 1449 times by 1 test: r_reading_until:case r_reading_until: Executed by:
executed 1449 times by 1 test: case r_reading_until: Executed by:
| 1449 | ||||||
115 | case executed 14 times by 1 test: r_deblank_reading_until:case r_deblank_reading_until: Executed by:
executed 14 times by 1 test: case r_deblank_reading_until: Executed by:
| 14 | ||||||
116 | new_redirect->here_doc_eof = redirect->here_doc_eof
| 0-1463 | ||||||
117 | - | |||||||
118 | case executed 70 times by 1 test: r_reading_string:case r_reading_string: Executed by:
executed 70 times by 1 test: case r_reading_string: Executed by:
code before this statement executed 1463 times by 1 test: case r_reading_string: Executed by:
| 70-1463 | ||||||
119 | case executed 64 times by 1 test: r_appending_to:case r_appending_to: Executed by:
executed 64 times by 1 test: case r_appending_to: Executed by:
| 64 | ||||||
120 | case executed 20682 times by 1 test: r_output_direction:case r_output_direction: Executed by:
executed 20682 times by 1 test: case r_output_direction: Executed by:
| 20682 | ||||||
121 | case executed 4218 times by 1 test: r_input_direction:case r_input_direction: Executed by:
executed 4218 times by 1 test: case r_input_direction: Executed by:
| 4218 | ||||||
122 | case never executed: r_inputa_direction:case r_inputa_direction: never executed: case r_inputa_direction: | 0 | ||||||
123 | case executed 45 times by 1 test: r_err_and_out:case r_err_and_out: Executed by:
executed 45 times by 1 test: case r_err_and_out: Executed by:
| 45 | ||||||
124 | case executed 6 times by 1 test: r_append_err_and_out:case r_append_err_and_out: Executed by:
executed 6 times by 1 test: case r_append_err_and_out: Executed by:
| 6 | ||||||
125 | case never executed: r_input_output:case r_input_output: never executed: case r_input_output: | 0 | ||||||
126 | case never executed: r_output_force:case r_output_force: never executed: case r_output_force: | 0 | ||||||
127 | case executed 4 times by 1 test: r_duplicating_input_word:case r_duplicating_input_word: Executed by:
executed 4 times by 1 test: case r_duplicating_input_word: Executed by:
| 4 | ||||||
128 | case executed 22 times by 1 test: r_duplicating_output_word:case r_duplicating_output_word: Executed by:
executed 22 times by 1 test: case r_duplicating_output_word: Executed by:
| 22 | ||||||
129 | case executed 8 times by 1 test: r_move_input_word:case r_move_input_word: Executed by:
executed 8 times by 1 test: case r_move_input_word: Executed by:
| 8 | ||||||
130 | case executed 8 times by 1 test: r_move_output_word:case r_move_output_word: Executed by:
executed 8 times by 1 test: case r_move_output_word: Executed by:
| 8 | ||||||
131 | new_redirect->redirectee.filename = copy_word (redirect->redirectee.filename); | - | ||||||
132 | break; executed 26590 times by 1 test: break; Executed by:
| 26590 | ||||||
133 | case executed 65 times by 1 test: r_duplicating_input:case r_duplicating_input: Executed by:
executed 65 times by 1 test: case r_duplicating_input: Executed by:
| 65 | ||||||
134 | case executed 31747 times by 1 test: r_duplicating_output:case r_duplicating_output: Executed by:
executed 31747 times by 1 test: case r_duplicating_output: Executed by:
| 31747 | ||||||
135 | case executed 4 times by 1 test: r_move_input:case r_move_input: Executed by:
executed 4 times by 1 test: case r_move_input: Executed by:
| 4 | ||||||
136 | case never executed: r_move_output:case r_move_output: never executed: case r_move_output: | 0 | ||||||
137 | case executed 718726 times by 1 test: r_close_this:case r_close_this: Executed by:
executed 718726 times by 1 test: case r_close_this: Executed by:
| 718726 | ||||||
138 | break; executed 750542 times by 1 test: break; Executed by:
| 750542 | ||||||
139 | } | - | ||||||
140 | return executed 777132 times by 1 test: (new_redirect);return (new_redirect); Executed by:
executed 777132 times by 1 test: return (new_redirect); Executed by:
| 777132 | ||||||
141 | } | - | ||||||
142 | - | |||||||
143 | REDIRECT * | - | ||||||
144 | copy_redirects (list) | - | ||||||
145 | REDIRECT *list; | - | ||||||
146 | { | - | ||||||
147 | REDIRECT *new_list, *temp; | - | ||||||
148 | - | |||||||
149 | for (new_list = (REDIRECT *) | - | ||||||
150 | ((void *)0) | - | ||||||
151 | ; list
| 749418-775790 | ||||||
152 | { | - | ||||||
153 | temp = copy_redirect (list); | - | ||||||
154 | temp->next = new_list; | - | ||||||
155 | new_list = temp; | - | ||||||
156 | } executed 775790 times by 1 test: end of block Executed by:
| 775790 | ||||||
157 | return executed 749418 times by 1 test: (((new_list && new_list->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)new_list) : (REDIRECT *)(new_list)));return (((new_list && new_list->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)new_list) : (REDIRECT *)(new_list))); Executed by:
executed 749418 times by 1 test: return (((new_list && new_list->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)new_list) : (REDIRECT *)(new_list))); Executed by:
| 749418 | ||||||
158 | } | - | ||||||
159 | - | |||||||
160 | static FOR_COM * | - | ||||||
161 | copy_for_command (com) | - | ||||||
162 | FOR_COM *com; | - | ||||||
163 | { | - | ||||||
164 | FOR_COM *new_for; | - | ||||||
165 | - | |||||||
166 | new_for = (FOR_COM *)sh_xmalloc((sizeof (FOR_COM)), "copy_cmd.c", 185); | - | ||||||
167 | new_for->flags = com->flags; | - | ||||||
168 | new_for->line = com->line; | - | ||||||
169 | new_for->name = copy_word (com->name); | - | ||||||
170 | new_for->map_list = copy_word_list (com->map_list); | - | ||||||
171 | new_for->action = copy_command (com->action); | - | ||||||
172 | return executed 1620722 times by 1 test: (new_for);return (new_for); Executed by:
executed 1620722 times by 1 test: return (new_for); Executed by:
| 1620722 | ||||||
173 | } | - | ||||||
174 | - | |||||||
175 | - | |||||||
176 | static ARITH_FOR_COM * | - | ||||||
177 | copy_arith_for_command (com) | - | ||||||
178 | ARITH_FOR_COM *com; | - | ||||||
179 | { | - | ||||||
180 | ARITH_FOR_COM *new_arith_for; | - | ||||||
181 | - | |||||||
182 | new_arith_for = (ARITH_FOR_COM *)sh_xmalloc((sizeof (ARITH_FOR_COM)), "copy_cmd.c", 201); | - | ||||||
183 | new_arith_for->flags = com->flags; | - | ||||||
184 | new_arith_for->line = com->line; | - | ||||||
185 | new_arith_for->init = copy_word_list (com->init); | - | ||||||
186 | new_arith_for->test = copy_word_list (com->test); | - | ||||||
187 | new_arith_for->step = copy_word_list (com->step); | - | ||||||
188 | new_arith_for->action = copy_command (com->action); | - | ||||||
189 | return executed 4263 times by 1 test: (new_arith_for);return (new_arith_for); Executed by:
executed 4263 times by 1 test: return (new_arith_for); Executed by:
| 4263 | ||||||
190 | } | - | ||||||
191 | - | |||||||
192 | - | |||||||
193 | static GROUP_COM * | - | ||||||
194 | copy_group_command (com) | - | ||||||
195 | GROUP_COM *com; | - | ||||||
196 | { | - | ||||||
197 | GROUP_COM *new_group; | - | ||||||
198 | - | |||||||
199 | new_group = (GROUP_COM *)sh_xmalloc((sizeof (GROUP_COM)), "copy_cmd.c", 218); | - | ||||||
200 | new_group->command = copy_command (com->command); | - | ||||||
201 | return executed 1663251 times by 1 test: (new_group);return (new_group); Executed by:
executed 1663251 times by 1 test: return (new_group); Executed by:
| 1663251 | ||||||
202 | } | - | ||||||
203 | - | |||||||
204 | static SUBSHELL_COM * | - | ||||||
205 | copy_subshell_command (com) | - | ||||||
206 | SUBSHELL_COM *com; | - | ||||||
207 | { | - | ||||||
208 | SUBSHELL_COM *new_subshell; | - | ||||||
209 | - | |||||||
210 | new_subshell = (SUBSHELL_COM *)sh_xmalloc((sizeof (SUBSHELL_COM)), "copy_cmd.c", 229); | - | ||||||
211 | new_subshell->command = copy_command (com->command); | - | ||||||
212 | new_subshell->flags = com->flags; | - | ||||||
213 | new_subshell->line = com->line; | - | ||||||
214 | return executed 3584 times by 1 test: (new_subshell);return (new_subshell); Executed by:
executed 3584 times by 1 test: return (new_subshell); Executed by:
| 3584 | ||||||
215 | } | - | ||||||
216 | - | |||||||
217 | static COPROC_COM * | - | ||||||
218 | copy_coproc_command (com) | - | ||||||
219 | COPROC_COM *com; | - | ||||||
220 | { | - | ||||||
221 | COPROC_COM *new_coproc; | - | ||||||
222 | - | |||||||
223 | new_coproc = (COPROC_COM *)sh_xmalloc((sizeof (COPROC_COM)), "copy_cmd.c", 242); | - | ||||||
224 | new_coproc->name = (char *)strcpy (sh_xmalloc((1 + strlen (com->name)), "copy_cmd.c", 243), (com->name)); | - | ||||||
225 | new_coproc->command = copy_command (com->command); | - | ||||||
226 | new_coproc->flags = com->flags; | - | ||||||
227 | return executed 9 times by 1 test: (new_coproc);return (new_coproc); Executed by:
executed 9 times by 1 test: return (new_coproc); Executed by:
| 9 | ||||||
228 | } | - | ||||||
229 | - | |||||||
230 | static CASE_COM * | - | ||||||
231 | copy_case_command (com) | - | ||||||
232 | CASE_COM *com; | - | ||||||
233 | { | - | ||||||
234 | CASE_COM *new_case; | - | ||||||
235 | - | |||||||
236 | new_case = (CASE_COM *)sh_xmalloc((sizeof (CASE_COM)), "copy_cmd.c", 255); | - | ||||||
237 | new_case->flags = com->flags; | - | ||||||
238 | new_case->line = com->line; | - | ||||||
239 | new_case->word = copy_word (com->word); | - | ||||||
240 | new_case->clauses = copy_case_clauses (com->clauses); | - | ||||||
241 | return executed 32402567 times by 1 test: (new_case);return (new_case); Executed by:
executed 32402567 times by 1 test: return (new_case); Executed by:
| 32402567 | ||||||
242 | } | - | ||||||
243 | - | |||||||
244 | static WHILE_COM * | - | ||||||
245 | copy_while_command (com) | - | ||||||
246 | WHILE_COM *com; | - | ||||||
247 | { | - | ||||||
248 | WHILE_COM *new_while; | - | ||||||
249 | - | |||||||
250 | new_while = (WHILE_COM *)sh_xmalloc((sizeof (WHILE_COM)), "copy_cmd.c", 269); | - | ||||||
251 | new_while->flags = com->flags; | - | ||||||
252 | new_while->test = copy_command (com->test); | - | ||||||
253 | new_while->action = copy_command (com->action); | - | ||||||
254 | return executed 1627980 times by 1 test: (new_while);return (new_while); Executed by:
executed 1627980 times by 1 test: return (new_while); Executed by:
| 1627980 | ||||||
255 | } | - | ||||||
256 | - | |||||||
257 | static IF_COM * | - | ||||||
258 | copy_if_command (com) | - | ||||||
259 | IF_COM *com; | - | ||||||
260 | { | - | ||||||
261 | IF_COM *new_if; | - | ||||||
262 | - | |||||||
263 | new_if = (IF_COM *)sh_xmalloc((sizeof (IF_COM)), "copy_cmd.c", 282); | - | ||||||
264 | new_if->flags = com->flags; | - | ||||||
265 | new_if->test = copy_command (com->test); | - | ||||||
266 | new_if->true_case = copy_command (com->true_case); | - | ||||||
267 | new_if->false_case = com->false_case
| 442-3295 | ||||||
268 | return executed 3737 times by 1 test: (new_if);return (new_if); Executed by:
executed 3737 times by 1 test: return (new_if); Executed by:
| 3737 | ||||||
269 | } | - | ||||||
270 | - | |||||||
271 | - | |||||||
272 | static ARITH_COM * | - | ||||||
273 | copy_arith_command (com) | - | ||||||
274 | ARITH_COM *com; | - | ||||||
275 | { | - | ||||||
276 | ARITH_COM *new_arith; | - | ||||||
277 | - | |||||||
278 | new_arith = (ARITH_COM *)sh_xmalloc((sizeof (ARITH_COM)), "copy_cmd.c", 297); | - | ||||||
279 | new_arith->flags = com->flags; | - | ||||||
280 | new_arith->exp = copy_word_list (com->exp); | - | ||||||
281 | new_arith->line = com->line; | - | ||||||
282 | - | |||||||
283 | return executed 16202994 times by 1 test: (new_arith);return (new_arith); Executed by:
executed 16202994 times by 1 test: return (new_arith); Executed by:
| 16202994 | ||||||
284 | } | - | ||||||
285 | - | |||||||
286 | - | |||||||
287 | - | |||||||
288 | static COND_COM * | - | ||||||
289 | copy_cond_command (com) | - | ||||||
290 | COND_COM *com; | - | ||||||
291 | { | - | ||||||
292 | COND_COM *new_cond; | - | ||||||
293 | - | |||||||
294 | new_cond = (COND_COM *)sh_xmalloc((sizeof (COND_COM)), "copy_cmd.c", 313); | - | ||||||
295 | new_cond->flags = com->flags; | - | ||||||
296 | new_cond->line = com->line; | - | ||||||
297 | new_cond->type = com->type; | - | ||||||
298 | new_cond->op = com->op
| 170-2161 | ||||||
299 | new_cond->left = com->left
| 995-1336 | ||||||
300 | ((void *)0) | - | ||||||
301 | ; | - | ||||||
302 | new_cond->right = com->right
| 673-1658 | ||||||
303 | ((void *)0) | - | ||||||
304 | ; | - | ||||||
305 | - | |||||||
306 | return executed 2331 times by 1 test: (new_cond);return (new_cond); Executed by:
executed 2331 times by 1 test: return (new_cond); Executed by:
| 2331 | ||||||
307 | } | - | ||||||
308 | - | |||||||
309 | - | |||||||
310 | static SIMPLE_COM * | - | ||||||
311 | copy_simple_command (com) | - | ||||||
312 | SIMPLE_COM *com; | - | ||||||
313 | { | - | ||||||
314 | SIMPLE_COM *new_simple; | - | ||||||
315 | - | |||||||
316 | new_simple = (SIMPLE_COM *)sh_xmalloc((sizeof (SIMPLE_COM)), "copy_cmd.c", 331); | - | ||||||
317 | new_simple->flags = com->flags; | - | ||||||
318 | new_simple->words = copy_word_list (com->words); | - | ||||||
319 | new_simple->redirects = com->redirects
| 26406-55201281 | ||||||
320 | ((void *)0) | - | ||||||
321 | ; | - | ||||||
322 | new_simple->line = com->line; | - | ||||||
323 | return executed 55227687 times by 1 test: (new_simple);return (new_simple); Executed by:
executed 55227687 times by 1 test: return (new_simple); Executed by:
| 55227687 | ||||||
324 | } | - | ||||||
325 | - | |||||||
326 | FUNCTION_DEF * | - | ||||||
327 | copy_function_def_contents (old, new_def) | - | ||||||
328 | FUNCTION_DEF *old, *new_def; | - | ||||||
329 | { | - | ||||||
330 | new_def->name = copy_word (old->name); | - | ||||||
331 | new_def->command = old->command
| 9919-11183 | ||||||
332 | new_def->flags = old->flags; | - | ||||||
333 | new_def->line = old->line; | - | ||||||
334 | new_def->source_file = old->source_file
| 0-21102 | ||||||
335 | return executed 21102 times by 1 test: (new_def);return (new_def); Executed by:
executed 21102 times by 1 test: return (new_def); Executed by:
| 21102 | ||||||
336 | } | - | ||||||
337 | - | |||||||
338 | FUNCTION_DEF * | - | ||||||
339 | copy_function_def (com) | - | ||||||
340 | FUNCTION_DEF *com; | - | ||||||
341 | { | - | ||||||
342 | FUNCTION_DEF *new_def; | - | ||||||
343 | - | |||||||
344 | new_def = (FUNCTION_DEF *)sh_xmalloc((sizeof (FUNCTION_DEF)), "copy_cmd.c", 357); | - | ||||||
345 | new_def = copy_function_def_contents (com, new_def); | - | ||||||
346 | return executed 9948 times by 1 test: (new_def);return (new_def); Executed by:
executed 9948 times by 1 test: return (new_def); Executed by:
| 9948 | ||||||
347 | } | - | ||||||
348 | - | |||||||
349 | - | |||||||
350 | - | |||||||
351 | - | |||||||
352 | COMMAND * | - | ||||||
353 | copy_command (command) | - | ||||||
354 | COMMAND *command; | - | ||||||
355 | { | - | ||||||
356 | COMMAND *new_command; | - | ||||||
357 | - | |||||||
358 | if (command ==
| 9718149-139624710 | ||||||
359 | ((void *)0)
| 9718149-139624710 | ||||||
360 | ) | - | ||||||
361 | return executed 9718149 times by 1 test: (command);return (command); Executed by:
executed 9718149 times by 1 test: return (command); Executed by:
| 9718149 | ||||||
362 | - | |||||||
363 | new_command = (COMMAND *)sh_xmalloc((sizeof (COMMAND)), "copy_cmd.c", 374); | - | ||||||
364 | __builtin_memcpy (((char *)new_command), ((char *)command), (sizeof (COMMAND))); | - | ||||||
365 | new_command->flags = command->flags; | - | ||||||
366 | new_command->line = command->line; | - | ||||||
367 | - | |||||||
368 | if (command->redirects
| 4296-139620414 | ||||||
369 | new_command->redirects = copy_redirects (command->redirects); executed 4296 times by 1 test: new_command->redirects = copy_redirects (command->redirects); Executed by:
| 4296 | ||||||
370 | - | |||||||
371 | switch (command->type) | - | ||||||
372 | { | - | ||||||
373 | case executed 1620722 times by 1 test: cm_for:case cm_for: Executed by:
executed 1620722 times by 1 test: case cm_for: Executed by:
| 1620722 | ||||||
374 | new_command->value.For = copy_for_command (command->value.For); | - | ||||||
375 | break; executed 1620722 times by 1 test: break; Executed by:
| 1620722 | ||||||
376 | - | |||||||
377 | - | |||||||
378 | case executed 4263 times by 1 test: cm_arith_for:case cm_arith_for: Executed by:
executed 4263 times by 1 test: case cm_arith_for: Executed by:
| 4263 | ||||||
379 | new_command->value.ArithFor = copy_arith_for_command (command->value.ArithFor); | - | ||||||
380 | break; executed 4263 times by 1 test: break; Executed by:
| 4263 | ||||||
381 | - | |||||||
382 | - | |||||||
383 | - | |||||||
384 | case never executed: cm_select:case cm_select: never executed: case cm_select: | 0 | ||||||
385 | new_command->value.Select = | - | ||||||
386 | (SELECT_COM *)copy_for_command ((FOR_COM *)command->value.Select); | - | ||||||
387 | break; never executed: break; | 0 | ||||||
388 | - | |||||||
389 | - | |||||||
390 | case executed 1663251 times by 1 test: cm_group:case cm_group: Executed by:
executed 1663251 times by 1 test: case cm_group: Executed by:
| 1663251 | ||||||
391 | new_command->value.Group = copy_group_command (command->value.Group); | - | ||||||
392 | break; executed 1663251 times by 1 test: break; Executed by:
| 1663251 | ||||||
393 | - | |||||||
394 | case executed 3584 times by 1 test: cm_subshell:case cm_subshell: Executed by:
executed 3584 times by 1 test: case cm_subshell: Executed by:
| 3584 | ||||||
395 | new_command->value.Subshell = copy_subshell_command (command->value.Subshell); | - | ||||||
396 | break; executed 3584 times by 1 test: break; Executed by:
| 3584 | ||||||
397 | - | |||||||
398 | case executed 9 times by 1 test: cm_coproc:case cm_coproc: Executed by:
executed 9 times by 1 test: case cm_coproc: Executed by:
| 9 | ||||||
399 | new_command->value.Coproc = copy_coproc_command (command->value.Coproc); | - | ||||||
400 | break; executed 9 times by 1 test: break; Executed by:
| 9 | ||||||
401 | - | |||||||
402 | case executed 32402567 times by 1 test: cm_case:case cm_case: Executed by:
executed 32402567 times by 1 test: case cm_case: Executed by:
| 32402567 | ||||||
403 | new_command->value.Case = copy_case_command (command->value.Case); | - | ||||||
404 | break; executed 32402567 times by 1 test: break; Executed by:
| 32402567 | ||||||
405 | - | |||||||
406 | case executed 20 times by 1 test: cm_until:case cm_until: Executed by:
executed 20 times by 1 test: case cm_until: Executed by:
| 20 | ||||||
407 | case executed 1627960 times by 1 test: cm_while:case cm_while: Executed by:
executed 1627960 times by 1 test: case cm_while: Executed by:
| 1627960 | ||||||
408 | new_command->value.While = copy_while_command (command->value.While); | - | ||||||
409 | break; executed 1627980 times by 1 test: break; Executed by:
| 1627980 | ||||||
410 | - | |||||||
411 | case executed 3737 times by 1 test: cm_if:case cm_if: Executed by:
executed 3737 times by 1 test: case cm_if: Executed by:
| 3737 | ||||||
412 | new_command->value.If = copy_if_command (command->value.If); | - | ||||||
413 | break; executed 3737 times by 1 test: break; Executed by:
| 3737 | ||||||
414 | - | |||||||
415 | - | |||||||
416 | case executed 16202994 times by 1 test: cm_arith:case cm_arith: Executed by:
executed 16202994 times by 1 test: case cm_arith: Executed by:
| 16202994 | ||||||
417 | new_command->value.Arith = copy_arith_command (command->value.Arith); | - | ||||||
418 | break; executed 16202994 times by 1 test: break; Executed by:
| 16202994 | ||||||
419 | - | |||||||
420 | - | |||||||
421 | - | |||||||
422 | case executed 663 times by 1 test: cm_cond:case cm_cond: Executed by:
executed 663 times by 1 test: case cm_cond: Executed by:
| 663 | ||||||
423 | new_command->value.Cond = copy_cond_command (command->value.Cond); | - | ||||||
424 | break; executed 663 times by 1 test: break; Executed by:
| 663 | ||||||
425 | - | |||||||
426 | - | |||||||
427 | case executed 55227687 times by 1 test: cm_simple:case cm_simple: Executed by:
executed 55227687 times by 1 test: case cm_simple: Executed by:
| 55227687 | ||||||
428 | new_command->value.Simple = copy_simple_command (command->value.Simple); | - | ||||||
429 | break; executed 55227687 times by 1 test: break; Executed by:
| 55227687 | ||||||
430 | - | |||||||
431 | case executed 30867224 times by 1 test: cm_connection:case cm_connection: Executed by:
executed 30867224 times by 1 test: case cm_connection: Executed by:
| 30867224 | ||||||
432 | { | - | ||||||
433 | CONNECTION *new_connection; | - | ||||||
434 | - | |||||||
435 | new_connection = (CONNECTION *)sh_xmalloc((sizeof (CONNECTION)), "copy_cmd.c", 446); | - | ||||||
436 | new_connection->connector = command->value.Connection->connector; | - | ||||||
437 | new_connection->first = copy_command (command->value.Connection->first); | - | ||||||
438 | new_connection->second = copy_command (command->value.Connection->second); | - | ||||||
439 | new_command->value.Connection = new_connection; | - | ||||||
440 | break; executed 30867224 times by 1 test: break; Executed by:
| 30867224 | ||||||
441 | } | - | ||||||
442 | - | |||||||
443 | case executed 29 times by 1 test: cm_function_def:case cm_function_def: Executed by:
executed 29 times by 1 test: case cm_function_def: Executed by:
| 29 | ||||||
444 | new_command->value.Function_def = copy_function_def (command->value.Function_def); | - | ||||||
445 | break; executed 29 times by 1 test: break; Executed by:
| 29 | ||||||
446 | } | - | ||||||
447 | return executed 139624710 times by 1 test: (new_command);return (new_command); Executed by:
executed 139624710 times by 1 test: return (new_command); Executed by:
| 139624710 | ||||||
448 | } | - | ||||||
Switch to Source code | Preprocessed file |