OpenCoverage

copy_cmd.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/copy_cmd.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8static PATTERN_LIST *copy_case_clause (PATTERN_LIST *);-
9static PATTERN_LIST *copy_case_clauses (PATTERN_LIST *);-
10static FOR_COM *copy_for_command (FOR_COM *);-
11-
12static ARITH_FOR_COM *copy_arith_for_command (ARITH_FOR_COM *);-
13-
14static GROUP_COM *copy_group_command (GROUP_COM *);-
15static SUBSHELL_COM *copy_subshell_command (SUBSHELL_COM *);-
16static COPROC_COM *copy_coproc_command (COPROC_COM *);-
17static CASE_COM *copy_case_command (CASE_COM *);-
18static WHILE_COM *copy_while_command (WHILE_COM *);-
19static IF_COM *copy_if_command (IF_COM *);-
20-
21static ARITH_COM *copy_arith_command (ARITH_COM *);-
22-
23-
24static COND_COM *copy_cond_command (COND_COM *);-
25-
26static SIMPLE_COM *copy_simple_command (SIMPLE_COM *);-
27-
28WORD_DESC *-
29copy_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: return (new_word);
Executed by:
  • Self test
(new_word);
executed 319828941 times by 1 test: return (new_word);
Executed by:
  • Self test
319828941
37}-
38-
39-
40-
41WORD_LIST *-
42copy_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
listDescription
TRUEevaluated 285088166 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 232919229 times by 1 test
Evaluated by:
  • Self test
; list = list->next)
232919229-285088166
50 {-
51 if (new_list == 0
new_list == 0Description
TRUEevaluated 226381567 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 58706599 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
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:
  • Self test
58706599
60 }-
61-
62 return
executed 232919229 times by 1 test: return (new_list);
Executed by:
  • Self test
(new_list);
executed 232919229 times by 1 test: return (new_list);
Executed by:
  • Self test
232919229
63}-
64-
65static PATTERN_LIST *-
66copy_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: return (new_clause);
Executed by:
  • Self test
(new_clause);
executed 79389514 times by 1 test: return (new_clause);
Executed by:
  • Self test
79389514
76}-
77-
78static PATTERN_LIST *-
79copy_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
clausesDescription
TRUEevaluated 79389514 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 32402567 times by 1 test
Evaluated by:
  • Self test
; clauses = clauses->next)
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:
  • Self test
79389514
92 return
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:
  • Self test
(((new_list && new_list->next) ? (PATTERN_LIST *)list_reverse ((GENERIC_LIST *)new_list) : (PATTERN_LIST *)(new_list)));
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:
  • Self test
32402567
93}-
94-
95-
96REDIRECT *-
97copy_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
redirect->rflags & 0x01Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 777072 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
60
111-
112 switch (redirect->instruction)-
113 {-
114 case
executed 1449 times by 1 test: case r_reading_until:
Executed by:
  • Self test
r_reading_until:
executed 1449 times by 1 test: case r_reading_until:
Executed by:
  • Self test
1449
115 case
executed 14 times by 1 test: case r_deblank_reading_until:
Executed by:
  • Self test
r_deblank_reading_until:
executed 14 times by 1 test: case r_deblank_reading_until:
Executed by:
  • Self test
14
116 new_redirect->here_doc_eof = redirect->here_doc_eof
redirect->here_doc_eofDescription
TRUEevaluated 1463 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
? (char *)strcpy (sh_xmalloc((1 + strlen (redirect->here_doc_eof)), "copy_cmd.c", 137), (redirect->here_doc_eof)) : 0;
0-1463
117-
118 case
executed 70 times by 1 test: case r_reading_string:
Executed by:
  • Self test
r_reading_string:
executed 70 times by 1 test: case r_reading_string:
Executed by:
  • Self test
code before this statement executed 1463 times by 1 test: case r_reading_string:
Executed by:
  • Self test
70-1463
119 case
executed 64 times by 1 test: case r_appending_to:
Executed by:
  • Self test
r_appending_to:
executed 64 times by 1 test: case r_appending_to:
Executed by:
  • Self test
64
120 case
executed 20682 times by 1 test: case r_output_direction:
Executed by:
  • Self test
r_output_direction:
executed 20682 times by 1 test: case r_output_direction:
Executed by:
  • Self test
20682
121 case
executed 4218 times by 1 test: case r_input_direction:
Executed by:
  • Self test
r_input_direction:
executed 4218 times by 1 test: case r_input_direction:
Executed by:
  • Self test
4218
122 case
never executed: case r_inputa_direction:
r_inputa_direction:
never executed: case r_inputa_direction:
0
123 case
executed 45 times by 1 test: case r_err_and_out:
Executed by:
  • Self test
r_err_and_out:
executed 45 times by 1 test: case r_err_and_out:
Executed by:
  • Self test
45
124 case
executed 6 times by 1 test: case r_append_err_and_out:
Executed by:
  • Self test
r_append_err_and_out:
executed 6 times by 1 test: case r_append_err_and_out:
Executed by:
  • Self test
6
125 case
never executed: case r_input_output:
r_input_output:
never executed: case r_input_output:
0
126 case
never executed: case r_output_force:
r_output_force:
never executed: case r_output_force:
0
127 case
executed 4 times by 1 test: case r_duplicating_input_word:
Executed by:
  • Self test
r_duplicating_input_word:
executed 4 times by 1 test: case r_duplicating_input_word:
Executed by:
  • Self test
4
128 case
executed 22 times by 1 test: case r_duplicating_output_word:
Executed by:
  • Self test
r_duplicating_output_word:
executed 22 times by 1 test: case r_duplicating_output_word:
Executed by:
  • Self test
22
129 case
executed 8 times by 1 test: case r_move_input_word:
Executed by:
  • Self test
r_move_input_word:
executed 8 times by 1 test: case r_move_input_word:
Executed by:
  • Self test
8
130 case
executed 8 times by 1 test: case r_move_output_word:
Executed by:
  • Self test
r_move_output_word:
executed 8 times by 1 test: case r_move_output_word:
Executed by:
  • Self test
8
131 new_redirect->redirectee.filename = copy_word (redirect->redirectee.filename);-
132 break;
executed 26590 times by 1 test: break;
Executed by:
  • Self test
26590
133 case
executed 65 times by 1 test: case r_duplicating_input:
Executed by:
  • Self test
r_duplicating_input:
executed 65 times by 1 test: case r_duplicating_input:
Executed by:
  • Self test
65
134 case
executed 31747 times by 1 test: case r_duplicating_output:
Executed by:
  • Self test
r_duplicating_output:
executed 31747 times by 1 test: case r_duplicating_output:
Executed by:
  • Self test
31747
135 case
executed 4 times by 1 test: case r_move_input:
Executed by:
  • Self test
r_move_input:
executed 4 times by 1 test: case r_move_input:
Executed by:
  • Self test
4
136 case
never executed: case r_move_output:
r_move_output:
never executed: case r_move_output:
0
137 case
executed 718726 times by 1 test: case r_close_this:
Executed by:
  • Self test
r_close_this:
executed 718726 times by 1 test: case r_close_this:
Executed by:
  • Self test
718726
138 break;
executed 750542 times by 1 test: break;
Executed by:
  • Self test
750542
139 }-
140 return
executed 777132 times by 1 test: return (new_redirect);
Executed by:
  • Self test
(new_redirect);
executed 777132 times by 1 test: return (new_redirect);
Executed by:
  • Self test
777132
141}-
142-
143REDIRECT *-
144copy_redirects (list)-
145 REDIRECT *list;-
146{-
147 REDIRECT *new_list, *temp;-
148-
149 for (new_list = (REDIRECT *)-
150 ((void *)0)-
151 ; list
listDescription
TRUEevaluated 775790 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 749418 times by 1 test
Evaluated by:
  • Self test
; list = list->next)
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:
  • Self test
775790
157 return
executed 749418 times by 1 test: return (((new_list && new_list->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)new_list) : (REDIRECT *)(new_list)));
Executed by:
  • Self test
(((new_list && new_list->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)new_list) : (REDIRECT *)(new_list)));
executed 749418 times by 1 test: return (((new_list && new_list->next) ? (REDIRECT *)list_reverse ((GENERIC_LIST *)new_list) : (REDIRECT *)(new_list)));
Executed by:
  • Self test
749418
158}-
159-
160static FOR_COM *-
161copy_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: return (new_for);
Executed by:
  • Self test
(new_for);
executed 1620722 times by 1 test: return (new_for);
Executed by:
  • Self test
1620722
173}-
174-
175-
176static ARITH_FOR_COM *-
177copy_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: return (new_arith_for);
Executed by:
  • Self test
(new_arith_for);
executed 4263 times by 1 test: return (new_arith_for);
Executed by:
  • Self test
4263
190}-
191-
192-
193static GROUP_COM *-
194copy_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: return (new_group);
Executed by:
  • Self test
(new_group);
executed 1663251 times by 1 test: return (new_group);
Executed by:
  • Self test
1663251
202}-
203-
204static SUBSHELL_COM *-
205copy_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: return (new_subshell);
Executed by:
  • Self test
(new_subshell);
executed 3584 times by 1 test: return (new_subshell);
Executed by:
  • Self test
3584
215}-
216-
217static COPROC_COM *-
218copy_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: return (new_coproc);
Executed by:
  • Self test
(new_coproc);
executed 9 times by 1 test: return (new_coproc);
Executed by:
  • Self test
9
228}-
229-
230static CASE_COM *-
231copy_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: return (new_case);
Executed by:
  • Self test
(new_case);
executed 32402567 times by 1 test: return (new_case);
Executed by:
  • Self test
32402567
242}-
243-
244static WHILE_COM *-
245copy_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: return (new_while);
Executed by:
  • Self test
(new_while);
executed 1627980 times by 1 test: return (new_while);
Executed by:
  • Self test
1627980
255}-
256-
257static IF_COM *-
258copy_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
com->false_caseDescription
TRUEevaluated 442 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3295 times by 1 test
Evaluated by:
  • Self test
? copy_command (com->false_case) : com->false_case;
442-3295
268 return
executed 3737 times by 1 test: return (new_if);
Executed by:
  • Self test
(new_if);
executed 3737 times by 1 test: return (new_if);
Executed by:
  • Self test
3737
269}-
270-
271-
272static ARITH_COM *-
273copy_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: return (new_arith);
Executed by:
  • Self test
(new_arith);
executed 16202994 times by 1 test: return (new_arith);
Executed by:
  • Self test
16202994
284}-
285-
286-
287-
288static COND_COM *-
289copy_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
com->opDescription
TRUEevaluated 2161 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 170 times by 1 test
Evaluated by:
  • Self test
? copy_word (com->op) : com->op;
170-2161
299 new_cond->left = com->left
com->leftDescription
TRUEevaluated 995 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1336 times by 1 test
Evaluated by:
  • Self test
? copy_cond_command (com->left) : (COND_COM *)
995-1336
300 ((void *)0)-
301 ;-
302 new_cond->right = com->right
com->rightDescription
TRUEevaluated 673 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1658 times by 1 test
Evaluated by:
  • Self test
? copy_cond_command (com->right) : (COND_COM *)
673-1658
303 ((void *)0)-
304 ;-
305-
306 return
executed 2331 times by 1 test: return (new_cond);
Executed by:
  • Self test
(new_cond);
executed 2331 times by 1 test: return (new_cond);
Executed by:
  • Self test
2331
307}-
308-
309-
310static SIMPLE_COM *-
311copy_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
com->redirectsDescription
TRUEevaluated 26406 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 55201281 times by 1 test
Evaluated by:
  • Self test
? copy_redirects (com->redirects) : (REDIRECT *)
26406-55201281
320 ((void *)0)-
321 ;-
322 new_simple->line = com->line;-
323 return
executed 55227687 times by 1 test: return (new_simple);
Executed by:
  • Self test
(new_simple);
executed 55227687 times by 1 test: return (new_simple);
Executed by:
  • Self test
55227687
324}-
325-
326FUNCTION_DEF *-
327copy_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
old->commandDescription
TRUEevaluated 11183 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9919 times by 1 test
Evaluated by:
  • Self test
? copy_command (old->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
old->source_fileDescription
TRUEevaluated 21102 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
? (char *)strcpy (sh_xmalloc((1 + strlen (old->source_file)), "copy_cmd.c", 347), (old->source_file)) : old->source_file;
0-21102
335 return
executed 21102 times by 1 test: return (new_def);
Executed by:
  • Self test
(new_def);
executed 21102 times by 1 test: return (new_def);
Executed by:
  • Self test
21102
336}-
337-
338FUNCTION_DEF *-
339copy_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: return (new_def);
Executed by:
  • Self test
(new_def);
executed 9948 times by 1 test: return (new_def);
Executed by:
  • Self test
9948
347}-
348-
349-
350-
351-
352COMMAND *-
353copy_command (command)-
354 COMMAND *command;-
355{-
356 COMMAND *new_command;-
357-
358 if (command ==
command == ((void *)0)Description
TRUEevaluated 9718149 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 139624710 times by 1 test
Evaluated by:
  • Self test
9718149-139624710
359 ((void *)0)
command == ((void *)0)Description
TRUEevaluated 9718149 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 139624710 times by 1 test
Evaluated by:
  • Self test
9718149-139624710
360 )-
361 return
executed 9718149 times by 1 test: return (command);
Executed by:
  • Self test
(command);
executed 9718149 times by 1 test: return (command);
Executed by:
  • Self test
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
command->redirectsDescription
TRUEevaluated 4296 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 139620414 times by 1 test
Evaluated by:
  • Self test
)
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:
  • Self test
4296
370-
371 switch (command->type)-
372 {-
373 case
executed 1620722 times by 1 test: case cm_for:
Executed by:
  • Self test
cm_for:
executed 1620722 times by 1 test: case cm_for:
Executed by:
  • Self test
1620722
374 new_command->value.For = copy_for_command (command->value.For);-
375 break;
executed 1620722 times by 1 test: break;
Executed by:
  • Self test
1620722
376-
377-
378 case
executed 4263 times by 1 test: case cm_arith_for:
Executed by:
  • Self test
cm_arith_for:
executed 4263 times by 1 test: case cm_arith_for:
Executed by:
  • Self test
4263
379 new_command->value.ArithFor = copy_arith_for_command (command->value.ArithFor);-
380 break;
executed 4263 times by 1 test: break;
Executed by:
  • Self test
4263
381-
382-
383-
384 case
never executed: case cm_select:
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: case cm_group:
Executed by:
  • Self test
cm_group:
executed 1663251 times by 1 test: case cm_group:
Executed by:
  • Self test
1663251
391 new_command->value.Group = copy_group_command (command->value.Group);-
392 break;
executed 1663251 times by 1 test: break;
Executed by:
  • Self test
1663251
393-
394 case
executed 3584 times by 1 test: case cm_subshell:
Executed by:
  • Self test
cm_subshell:
executed 3584 times by 1 test: case cm_subshell:
Executed by:
  • Self test
3584
395 new_command->value.Subshell = copy_subshell_command (command->value.Subshell);-
396 break;
executed 3584 times by 1 test: break;
Executed by:
  • Self test
3584
397-
398 case
executed 9 times by 1 test: case cm_coproc:
Executed by:
  • Self test
cm_coproc:
executed 9 times by 1 test: case cm_coproc:
Executed by:
  • Self test
9
399 new_command->value.Coproc = copy_coproc_command (command->value.Coproc);-
400 break;
executed 9 times by 1 test: break;
Executed by:
  • Self test
9
401-
402 case
executed 32402567 times by 1 test: case cm_case:
Executed by:
  • Self test
cm_case:
executed 32402567 times by 1 test: case cm_case:
Executed by:
  • Self test
32402567
403 new_command->value.Case = copy_case_command (command->value.Case);-
404 break;
executed 32402567 times by 1 test: break;
Executed by:
  • Self test
32402567
405-
406 case
executed 20 times by 1 test: case cm_until:
Executed by:
  • Self test
cm_until:
executed 20 times by 1 test: case cm_until:
Executed by:
  • Self test
20
407 case
executed 1627960 times by 1 test: case cm_while:
Executed by:
  • Self test
cm_while:
executed 1627960 times by 1 test: case cm_while:
Executed by:
  • Self test
1627960
408 new_command->value.While = copy_while_command (command->value.While);-
409 break;
executed 1627980 times by 1 test: break;
Executed by:
  • Self test
1627980
410-
411 case
executed 3737 times by 1 test: case cm_if:
Executed by:
  • Self test
cm_if:
executed 3737 times by 1 test: case cm_if:
Executed by:
  • Self test
3737
412 new_command->value.If = copy_if_command (command->value.If);-
413 break;
executed 3737 times by 1 test: break;
Executed by:
  • Self test
3737
414-
415-
416 case
executed 16202994 times by 1 test: case cm_arith:
Executed by:
  • Self test
cm_arith:
executed 16202994 times by 1 test: case cm_arith:
Executed by:
  • Self test
16202994
417 new_command->value.Arith = copy_arith_command (command->value.Arith);-
418 break;
executed 16202994 times by 1 test: break;
Executed by:
  • Self test
16202994
419-
420-
421-
422 case
executed 663 times by 1 test: case cm_cond:
Executed by:
  • Self test
cm_cond:
executed 663 times by 1 test: case cm_cond:
Executed by:
  • Self test
663
423 new_command->value.Cond = copy_cond_command (command->value.Cond);-
424 break;
executed 663 times by 1 test: break;
Executed by:
  • Self test
663
425-
426-
427 case
executed 55227687 times by 1 test: case cm_simple:
Executed by:
  • Self test
cm_simple:
executed 55227687 times by 1 test: case cm_simple:
Executed by:
  • Self test
55227687
428 new_command->value.Simple = copy_simple_command (command->value.Simple);-
429 break;
executed 55227687 times by 1 test: break;
Executed by:
  • Self test
55227687
430-
431 case
executed 30867224 times by 1 test: case cm_connection:
Executed by:
  • Self test
cm_connection:
executed 30867224 times by 1 test: case cm_connection:
Executed by:
  • Self test
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:
  • Self test
30867224
441 }-
442-
443 case
executed 29 times by 1 test: case cm_function_def:
Executed by:
  • Self test
cm_function_def:
executed 29 times by 1 test: case cm_function_def:
Executed by:
  • Self test
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:
  • Self test
29
446 }-
447 return
executed 139624710 times by 1 test: return (new_command);
Executed by:
  • Self test
(new_command);
executed 139624710 times by 1 test: return (new_command);
Executed by:
  • Self test
139624710
448}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2