OpenCoverage

arrayfunc.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/arrayfunc.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16int assoc_expand_once = 0;-
17-
18-
19int array_expand_once = 0;-
20-
21static SHELL_VAR *bind_array_var_internal (SHELL_VAR *, arrayind_t, char *, char *, int);-
22static SHELL_VAR *assign_array_element_internal (SHELL_VAR *, char *, char *, char *, int, char *, int);-
23-
24static char *quote_assign (const char *);-
25static void quote_array_assignment_chars (WORD_LIST *);-
26static char *array_value_internal (const char *, int, int, int *, arrayind_t *);-
27-
28-
29const char * const bash_badsub_errmsg = "bad array subscript";-
30SHELL_VAR *-
31convert_var_to_array (var)-
32 SHELL_VAR *var;-
33{-
34 char *oldval;-
35 ARRAY *array;-
36-
37 oldval = ((var)->value);-
38 array = array_create ();-
39 if (oldval
oldvalDescription
TRUEevaluated 65 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
)
18-65
40 array_insert (array, 0, oldval);
executed 65 times by 1 test: array_insert (array, 0, oldval);
Executed by:
  • Self test
65
41-
42 do { if (((
((var)->value)Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
var)->value)
((var)->value)Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
) sh_xfree((((var)->value)), "arrayfunc.c", 80);
executed 65 times by 1 test: sh_xfree((((var)->value)), "arrayfunc.c", 80);
Executed by:
  • Self test
} while (0);
18-65
43 ((var)->value = (char *)(array));-
44-
45-
46 var->dynamic_value = (sh_var_value_func_t *)-
47 ((void *)0)-
48 ;-
49 var->assign_func = (sh_var_assign_func_t *)-
50 ((void *)0)-
51 ;-
52-
53 do { if ((
(var)->exportstrDescription
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • Self test
var)->exportstr
(var)->exportstrDescription
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • Self test
) { sh_xfree(((var)->exportstr), "arrayfunc.c", 87); (var)->exportstr = (char *)
0-83
54 ((void *)0)-
55 ; }
never executed: end of block
} while (0);
0
56 if (((((
((((var)->attr... (0x0000001)))Description
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000001)))
((((var)->attr... (0x0000001)))Description
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • Self test
)
0-83
57 array_needs_making++;
never executed: array_needs_making++;
0
58-
59 ((var)->attributes |= (0x0000004));-
60 ((var)->attributes &= ~(0x0001000));-
61-
62-
63 ((var)->attributes &= ~(0x0000040));-
64-
65-
66 ((var)->attributes &= ~(0x0000800));-
67-
68 return
executed 83 times by 1 test: return var;
Executed by:
  • Self test
var;
executed 83 times by 1 test: return var;
Executed by:
  • Self test
83
69}-
70-
71-
72-
73SHELL_VAR *-
74convert_var_to_assoc (var)-
75 SHELL_VAR *var;-
76{-
77 char *oldval;-
78 HASH_TABLE *hash;-
79-
80 oldval = ((var)->value);-
81 hash = (hash_create((0)));-
82 if (oldval
oldvalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2
83 assoc_insert (hash, (char *)strcpy (sh_xmalloc((1 + strlen ("0")), "arrayfunc.c", 115), ("0")), oldval);
executed 2 times by 1 test: assoc_insert (hash, (char *)strcpy (sh_xmalloc((1 + strlen ("0")), "arrayfunc.c", 115), ("0")), oldval);
Executed by:
  • Self test
2
84-
85 do { if (((
((var)->value)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->value)
((var)->value)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((((var)->value)), "arrayfunc.c", 117);
executed 2 times by 1 test: sh_xfree((((var)->value)), "arrayfunc.c", 117);
Executed by:
  • Self test
} while (0);
0-2
86 ((var)->value = (char *)(hash));-
87-
88-
89 var->dynamic_value = (sh_var_value_func_t *)-
90 ((void *)0)-
91 ;-
92 var->assign_func = (sh_var_assign_func_t *)-
93 ((void *)0)-
94 ;-
95-
96 do { if ((
(var)->exportstrDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
var)->exportstr
(var)->exportstrDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
) { sh_xfree(((var)->exportstr), "arrayfunc.c", 124); (var)->exportstr = (char *)
0-2
97 ((void *)0)-
98 ; }
never executed: end of block
} while (0);
0
99 if (((((
((((var)->attr... (0x0000001)))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000001)))
((((var)->attr... (0x0000001)))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
0-2
100 array_needs_making++;
never executed: array_needs_making++;
0
101-
102 ((var)->attributes |= (0x0000040));-
103 ((var)->attributes &= ~(0x0001000));-
104-
105-
106 ((var)->attributes &= ~(0x0000004));-
107-
108-
109 ((var)->attributes &= ~(0x0000800));-
110-
111 return
executed 2 times by 1 test: return var;
Executed by:
  • Self test
var;
executed 2 times by 1 test: return var;
Executed by:
  • Self test
2
112}-
113-
114char *-
115make_array_variable_value (entry, ind, key, value, flags)-
116 SHELL_VAR *entry;-
117 arrayind_t ind;-
118 char *key;-
119 char *value;-
120 int flags;-
121{-
122 SHELL_VAR *dentry;-
123 char *newval;-
124-
125-
126-
127 if (flags & 0x0001
flags & 0x0001Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14214 times by 1 test
Evaluated by:
  • Self test
)
14-14214
128 {-
129 dentry = (SHELL_VAR *)sh_xmalloc((sizeof (SHELL_VAR)), "arrayfunc.c", 155);-
130 dentry->name = (char *)strcpy (sh_xmalloc((1 + strlen (entry->name)), "arrayfunc.c", 156), (entry->name));-
131 if (((((
((((entry)->at... (0x0000040)))Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0000040)))
((((entry)->at... (0x0000040)))Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
)
7
132 newval = assoc_reference ((HASH_TABLE *)((entry)->value), key);
executed 7 times by 1 test: newval = assoc_reference ((HASH_TABLE *)((entry)->value), key);
Executed by:
  • Self test
7
133 else-
134 newval = array_reference ((ARRAY *)((entry)->value), ind);
executed 7 times by 1 test: newval = array_reference ((ARRAY *)((entry)->value), ind);
Executed by:
  • Self test
7
135 if (newval
newvalDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
3-11
136 dentry->value = (char *)strcpy (sh_xmalloc((1 + strlen (newval)), "arrayfunc.c", 162), (newval));
executed 11 times by 1 test: dentry->value = (char *)strcpy (sh_xmalloc((1 + strlen (newval)), "arrayfunc.c", 162), (newval));
Executed by:
  • Self test
11
137 else-
138 {-
139 dentry->value = (char *)sh_xmalloc((1), "arrayfunc.c", 165);-
140 dentry->value[0] = '\0';-
141 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test
3
142 dentry->exportstr = 0;-
143 dentry->attributes = entry->attributes & ~(0x0000004|0x0000040|0x0000001);-
144-
145-
146 newval = make_variable_value (dentry, value, flags);-
147 dispose_variable (dentry);-
148 }
executed 14 times by 1 test: end of block
Executed by:
  • Self test
14
149 else-
150 newval = make_variable_value (entry, value, flags);
executed 14214 times by 1 test: newval = make_variable_value (entry, value, flags);
Executed by:
  • Self test
14214
151-
152 return
executed 14228 times by 1 test: return newval;
Executed by:
  • Self test
newval;
executed 14228 times by 1 test: return newval;
Executed by:
  • Self test
14228
153}-
154-
155static SHELL_VAR *-
156bind_array_var_internal (entry, ind, key, value, flags)-
157 SHELL_VAR *entry;-
158 arrayind_t ind;-
159 char *key;-
160 char *value;-
161 int flags;-
162{-
163 char *newval;-
164-
165 newval = make_array_variable_value (entry, ind, key, value, flags);-
166-
167 if (entry->assign_func
entry->assign_funcDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14193 times by 1 test
Evaluated by:
  • Self test
)
5-14193
168 (*
executed 5 times by 1 test: (*entry->assign_func) (entry, newval, ind, key);
Executed by:
  • Self test
entry->assign_func) (entry, newval, ind, key);
executed 5 times by 1 test: (*entry->assign_func) (entry, newval, ind, key);
Executed by:
  • Self test
5
169 else if (((((
((((entry)->at... (0x0000040)))Description
TRUEevaluated 523 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13670 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0000040)))
((((entry)->at... (0x0000040)))Description
TRUEevaluated 523 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 13670 times by 1 test
Evaluated by:
  • Self test
)
523-13670
170 assoc_insert ((HASH_TABLE *)((entry)->value), key, newval);
executed 523 times by 1 test: assoc_insert ((HASH_TABLE *)((entry)->value), key, newval);
Executed by:
  • Self test
523
171 else-
172 array_insert ((ARRAY *)((entry)->value), ind, newval);
executed 13670 times by 1 test: array_insert ((ARRAY *)((entry)->value), ind, newval);
Executed by:
  • Self test
13670
173 do { if (newval
newvalDescription
TRUEevaluated 14198 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) sh_xfree((newval), "arrayfunc.c", 199);
executed 14198 times by 1 test: sh_xfree((newval), "arrayfunc.c", 199);
Executed by:
  • Self test
} while (0);
0-14198
174-
175 ((entry)->attributes &= ~(0x0001000));-
176 return
executed 14198 times by 1 test: return (entry);
Executed by:
  • Self test
(entry);
executed 14198 times by 1 test: return (entry);
Executed by:
  • Self test
14198
177}-
178SHELL_VAR *-
179bind_array_variable (name, ind, value, flags)-
180 char *name;-
181 arrayind_t ind;-
182 char *value;-
183 int flags;-
184{-
185 SHELL_VAR *entry;-
186-
187 entry = find_shell_variable (name);-
188-
189 if (entry == (SHELL_VAR *) 0
entry == (SHELL_VAR *) 0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10384 times by 1 test
Evaluated by:
  • Self test
)
48-10384
190 {-
191-
192 entry = find_variable_nameref_for_create (name, 0);-
193 if (entry == (void *)&nameref_invalid_value
entry == (void..._invalid_valueDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 43 times by 1 test
Evaluated by:
  • Self test
)
5-43
194 return
executed 5 times by 1 test: return ((SHELL_VAR *)0);
Executed by:
  • Self test
((SHELL_VAR *)0);
executed 5 times by 1 test: return ((SHELL_VAR *)0);
Executed by:
  • Self test
5
195 if (entry
entryDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((entry)->at... (0x0000800)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
entry)->attributes) & (0x0000800)))
((((entry)->at... (0x0000800)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-41
196 entry = make_new_array_variable (((entry)->value));
executed 2 times by 1 test: entry = make_new_array_variable (((entry)->value));
Executed by:
  • Self test
2
197 }
executed 43 times by 1 test: end of block
Executed by:
  • Self test
43
198 if (entry == (SHELL_VAR *) 0
entry == (SHELL_VAR *) 0Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10386 times by 1 test
Evaluated by:
  • Self test
)
41-10386
199 entry = make_new_array_variable (name);
executed 41 times by 1 test: entry = make_new_array_variable (name);
Executed by:
  • Self test
41
200 else if ((((((
((((entry)->at... (0x0000002)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10375 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0000002)))
((((entry)->at... (0x0000002)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10375 times by 1 test
Evaluated by:
  • Self test
&& (
(flags&0x0020) == 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
flags&0x0020) == 0
(flags&0x0020) == 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
) || ((((
((((entry)->at... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 10376 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0004000)))
((((entry)->at... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 10376 times by 1 test
Evaluated by:
  • Self test
)
0-10376
201 {-
202 if (((((
((((entry)->at... (0x0000002)))Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
entry)->attributes) & (0x0000002)))
((((entry)->at... (0x0000002)))Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-10
203 err_readonly (name);
executed 10 times by 1 test: err_readonly (name);
Executed by:
  • Self test
10
204 return
executed 10 times by 1 test: return (entry);
Executed by:
  • Self test
(entry);
executed 10 times by 1 test: return (entry);
Executed by:
  • Self test
10
205 }-
206 else if (((((
((((entry)->at...000004))) == 0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10352 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0000004))) == 0
((((entry)->at...000004))) == 0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10352 times by 1 test
Evaluated by:
  • Self test
)
24-10352
207 entry = convert_var_to_array (entry);
executed 24 times by 1 test: entry = convert_var_to_array (entry);
Executed by:
  • Self test
24
208-
209-
210 return
executed 10417 times by 1 test: return (bind_array_var_internal (entry, ind, 0, value, flags));
Executed by:
  • Self test
(bind_array_var_internal (entry, ind, 0, value, flags));
executed 10417 times by 1 test: return (bind_array_var_internal (entry, ind, 0, value, flags));
Executed by:
  • Self test
10417
211}-
212-
213SHELL_VAR *-
214bind_array_element (entry, ind, value, flags)-
215 SHELL_VAR *entry;-
216 arrayind_t ind;-
217 char *value;-
218 int flags;-
219{-
220 return
executed 141 times by 1 test: return (bind_array_var_internal (entry, ind, 0, value, flags));
Executed by:
  • Self test
(bind_array_var_internal (entry, ind, 0, value, flags));
executed 141 times by 1 test: return (bind_array_var_internal (entry, ind, 0, value, flags));
Executed by:
  • Self test
141
221}-
222-
223SHELL_VAR *-
224bind_assoc_variable (entry, name, key, value, flags)-
225 SHELL_VAR *entry;-
226 char *name;-
227 char *key;-
228 char *value;-
229 int flags;-
230{-
231 if ((((((
((((entry)->at... (0x0000002)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0000002)))
((((entry)->at... (0x0000002)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
&& (
(flags&0x0020) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags&0x0020) == 0
(flags&0x0020) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) || ((((
((((entry)->at... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0004000)))
((((entry)->at... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
)
0-371
232 {-
233 if (((((
((((entry)->at... (0x0000002)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
entry)->attributes) & (0x0000002)))
((((entry)->at... (0x0000002)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2
234 err_readonly (name);
executed 2 times by 1 test: err_readonly (name);
Executed by:
  • Self test
2
235 return
executed 2 times by 1 test: return (entry);
Executed by:
  • Self test
(entry);
executed 2 times by 1 test: return (entry);
Executed by:
  • Self test
2
236 }-
237-
238 return
executed 371 times by 1 test: return (bind_array_var_internal (entry, 0, key, value, flags));
Executed by:
  • Self test
(bind_array_var_internal (entry, 0, key, value, flags));
executed 371 times by 1 test: return (bind_array_var_internal (entry, 0, key, value, flags));
Executed by:
  • Self test
371
239}-
240-
241-
242-
243-
244SHELL_VAR *-
245assign_array_element (name, value, flags)-
246 char *name, *value;-
247 int flags;-
248{-
249 char *sub, *vname;-
250 int sublen;-
251 SHELL_VAR *entry;-
252-
253 vname = array_variable_name (name, (flags & 0x0080) != 0, &sub, &sublen);-
254-
255 if (vname == 0
vname == 0Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10787 times by 1 test
Evaluated by:
  • Self test
)
11-10787
256 return
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
((SHELL_VAR *)
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
11
257 ((void *)0)
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
11
258 );
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
11
259-
260 if ((((
(sub[0]) == '@'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10785 times by 1 test
Evaluated by:
  • Self test
sub[0]) == '@'
(sub[0]) == '@'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10785 times by 1 test
Evaluated by:
  • Self test
|| (
(sub[0]) == '*'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10771 times by 1 test
Evaluated by:
  • Self test
sub[0]) == '*'
(sub[0]) == '*'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10771 times by 1 test
Evaluated by:
  • Self test
) && sub[1] == ']'
sub[1] == ']'Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) || (
(sublen <= 1)Description
TRUEnever evaluated
FALSEevaluated 10771 times by 1 test
Evaluated by:
  • Self test
sublen <= 1)
(sublen <= 1)Description
TRUEnever evaluated
FALSEevaluated 10771 times by 1 test
Evaluated by:
  • Self test
)
0-10785
261 {-
262 sh_xfree((vname), "arrayfunc.c", 294);-
263 err_badarraysub (name);-
264 return
executed 16 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
((SHELL_VAR *)
executed 16 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
16
265 ((void *)0)
executed 16 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
16
266 );
executed 16 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
16
267 }-
268-
269 entry = find_variable (vname);-
270 entry = assign_array_element_internal (entry, name, vname, sub, sublen, value, flags);-
271-
272 sh_xfree((vname), "arrayfunc.c", 302);-
273 return
executed 10762 times by 1 test: return entry;
Executed by:
  • Self test
entry;
executed 10762 times by 1 test: return entry;
Executed by:
  • Self test
10762
274}-
275-
276static SHELL_VAR *-
277assign_array_element_internal (entry, name, vname, sub, sublen, value, flags)-
278 SHELL_VAR *entry;-
279 char *name;-
280 char *vname;-
281 char *sub;-
282 int sublen;-
283 char *value;-
284 int flags;-
285{-
286 char *akey;-
287 arrayind_t ind;-
288-
289 if (entry
entryDescription
TRUEevaluated 10723 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 48 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((entry)->at... (0x0000040)))Description
TRUEevaluated 372 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10351 times by 1 test
Evaluated by:
  • Self test
entry)->attributes) & (0x0000040)))
((((entry)->at... (0x0000040)))Description
TRUEevaluated 372 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10351 times by 1 test
Evaluated by:
  • Self test
)
48-10723
290 {-
291 sub[sublen-1] = '\0';-
292 if ((
(flags & 0x0080) == 0Description
TRUEevaluated 362 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test
flags & 0x0080) == 0
(flags & 0x0080) == 0Description
TRUEevaluated 362 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test
)
10-362
293 akey = expand_assignment_string_to_string (sub, 0);
executed 362 times by 1 test: akey = expand_assignment_string_to_string (sub, 0);
Executed by:
  • Self test
362
294 else-
295 akey = (char *)strcpy (sh_xmalloc((1 + strlen (sub)), "arrayfunc.c", 325), (sub));
executed 10 times by 1 test: akey = (char *)strcpy (sh_xmalloc((1 + strlen (sub)), "arrayfunc.c", 325), (sub));
Executed by:
  • Self test
10
296 sub[sublen-1] = ']';-
297 if (akey == 0
akey == 0Description
TRUEnever evaluated
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
|| *
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
akey == 0
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 371 times by 1 test
Evaluated by:
  • Self test
)
0-371
298 {-
299 err_badarraysub (name);-
300 do { if (akey
akeyDescription
TRUEnever evaluated
FALSEnever evaluated
) sh_xfree((akey), "arrayfunc.c", 330);
never executed: sh_xfree((akey), "arrayfunc.c", 330);
} while (0);
0
301 return
never executed: return ((SHELL_VAR *) ((void *)0) );
((SHELL_VAR *)
never executed: return ((SHELL_VAR *) ((void *)0) );
0
302 ((void *)0)
never executed: return ((SHELL_VAR *) ((void *)0) );
0
303 );
never executed: return ((SHELL_VAR *) ((void *)0) );
0
304 }-
305 entry = bind_assoc_variable (entry, vname, akey, value, flags);-
306 }
executed 371 times by 1 test: end of block
Executed by:
  • Self test
371
307 else-
308 {-
309 ind = array_expand_index (entry, sub, sublen, 0);-
310-
311 if (entry
entryDescription
TRUEevaluated 10343 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 48 times by 1 test
Evaluated by:
  • Self test
&& ind < 0
ind < 0Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10329 times by 1 test
Evaluated by:
  • Self test
)
14-10343
312 ind = (((((
((((entry)->at... (0x0000004)))Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
entry)->attributes) & (0x0000004)))
((((entry)->at... (0x0000004)))Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
? (((ARRAY *)((entry)->value))->max_index) : 0) + 1 + ind;
executed 14 times by 1 test: ind = (((((entry)->attributes) & (0x0000004))) ? (((ARRAY *)((entry)->value))->max_index) : 0) + 1 + ind;
Executed by:
  • Self test
0-14
313 if (ind < 0
ind < 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10381 times by 1 test
Evaluated by:
  • Self test
)
10-10381
314 {-
315 err_badarraysub (name);-
316 return
executed 10 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
((SHELL_VAR *)
executed 10 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
10
317 ((void *)0)
executed 10 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
10
318 );
executed 10 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
10
319 }-
320 entry = bind_array_variable (vname, ind, value, flags);-
321 }
executed 10381 times by 1 test: end of block
Executed by:
  • Self test
10381
322-
323 return
executed 10752 times by 1 test: return (entry);
Executed by:
  • Self test
(entry);
executed 10752 times by 1 test: return (entry);
Executed by:
  • Self test
10752
324}-
325-
326-
327-
328-
329-
330-
331-
332SHELL_VAR *-
333find_or_make_array_variable (name, flags)-
334 char *name;-
335 int flags;-
336{-
337 SHELL_VAR *var;-
338-
339 var = find_variable (name);-
340 if (var == 0
var == 0Description
TRUEevaluated 202 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 269 times by 1 test
Evaluated by:
  • Self test
)
202-269
341 {-
342-
343-
344 var = find_variable_last_nameref (name, 1);-
345 if (var
varDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 188 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr... (0x0000800)))Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000800)))
((((var)->attr... (0x0000800)))Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((((
((((var)->attr... (0x0001000)))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0001000)))
((((var)->attr... (0x0001000)))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
)
0-188
346 {-
347 internal_warning (-
348 dcgettext (((void *)0), -
349 "%s: removing nameref attribute"-
350 , 5)-
351 , name);-
352 ((var)->attributes &= ~(0x0000800));-
353 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test
5
354 if (var
varDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 188 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr... (0x0000800)))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000800)))
((((var)->attr... (0x0000800)))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
5-188
355 {-
356 if (valid_nameref_value (((var)->value), 2) == 0
valid_nameref_...alue), 2) == 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
1-8
357 {-
358 sh_invalidid (((var)->value));-
359 return
executed 8 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
((SHELL_VAR *)
executed 8 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
8
360 ((void *)0)
executed 8 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
8
361 );
executed 8 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
8
362 }-
363 var = (
(flags & 2)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
flags & 2)
(flags & 2)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
? make_new_assoc_variable (((var)->value)) : make_new_array_variable (((var)->value));
0-1
364 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test
1
365 }
executed 194 times by 1 test: end of block
Executed by:
  • Self test
194
366-
367 if (var == 0
var == 0Description
TRUEevaluated 188 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 275 times by 1 test
Evaluated by:
  • Self test
)
188-275
368 var = (
(flags & 2)Description
TRUEnever evaluated
FALSEevaluated 188 times by 1 test
Evaluated by:
  • Self test
flags & 2)
(flags & 2)Description
TRUEnever evaluated
FALSEevaluated 188 times by 1 test
Evaluated by:
  • Self test
? make_new_assoc_variable (name) : make_new_array_variable (name);
executed 188 times by 1 test: var = (flags & 2) ? make_new_assoc_variable (name) : make_new_array_variable (name);
Executed by:
  • Self test
0-188
369 else if ((
(flags & 1)Description
TRUEevaluated 275 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 1)
(flags & 1)Description
TRUEevaluated 275 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& (((((
((((var)->attr... (0x0000002)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 264 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000002)))
((((var)->attr... (0x0000002)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 264 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((var)->attr... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 264 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0004000)))
((((var)->attr... (0x0004000)))Description
TRUEnever evaluated
FALSEevaluated 264 times by 1 test
Evaluated by:
  • Self test
))
0-275
370 {-
371 if (((((
((((var)->attr... (0x0000002)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000002)))
((((var)->attr... (0x0000002)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-11
372 err_readonly (name);
executed 11 times by 1 test: err_readonly (name);
Executed by:
  • Self test
11
373 return
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
((SHELL_VAR *)
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
11
374 ((void *)0)
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
11
375 );
executed 11 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
11
376 }-
377 else if ((
(flags & 2)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 252 times by 1 test
Evaluated by:
  • Self test
flags & 2)
(flags & 2)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 252 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr... (0x0000004)))Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test
)
0-252
378 {-
379 last_command_exit_value = 1;-
380 report_error (-
381 dcgettext (((void *)0), -
382 "%s: cannot convert indexed to associative array"-
383 , 5)-
384 , name);-
385 return
never executed: return ((SHELL_VAR *) ((void *)0) );
((SHELL_VAR *)
never executed: return ((SHELL_VAR *) ((void *)0) );
0
386 ((void *)0)
never executed: return ((SHELL_VAR *) ((void *)0) );
0
387 );
never executed: return ((SHELL_VAR *) ((void *)0) );
0
388 }-
389 else if (((((
((((var)->attr...000004))) == 0Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 174 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004))) == 0
((((var)->attr...000004))) == 0Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 174 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr...000040))) == 0Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 61 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040))) == 0
((((var)->attr...000040))) == 0Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 61 times by 1 test
Evaluated by:
  • Self test
)
29-174
390 var = convert_var_to_array (var);
executed 29 times by 1 test: var = convert_var_to_array (var);
Executed by:
  • Self test
29
391-
392 return
executed 452 times by 1 test: return (var);
Executed by:
  • Self test
(var);
executed 452 times by 1 test: return (var);
Executed by:
  • Self test
452
393}-
394-
395-
396-
397SHELL_VAR *-
398assign_array_from_string (name, value, flags)-
399 char *name, *value;-
400 int flags;-
401{-
402 SHELL_VAR *var;-
403 int vflags;-
404-
405 vflags = 1;-
406 if (flags & 0x0004
flags & 0x0004Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 407 times by 1 test
Evaluated by:
  • Self test
)
12-407
407 vflags |= 2;
executed 12 times by 1 test: vflags |= 2;
Executed by:
  • Self test
12
408-
409 var = find_or_make_array_variable (name, vflags);-
410 if (var == 0
var == 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 404 times by 1 test
Evaluated by:
  • Self test
)
15-404
411 return
executed 15 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
((SHELL_VAR *)
executed 15 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
15
412 ((void *)0)
executed 15 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
15
413 );
executed 15 times by 1 test: return ((SHELL_VAR *) ((void *)0) );
Executed by:
  • Self test
15
414-
415 return
executed 404 times by 1 test: return (assign_array_var_from_string (var, value, flags));
Executed by:
  • Self test
(assign_array_var_from_string (var, value, flags));
executed 404 times by 1 test: return (assign_array_var_from_string (var, value, flags));
Executed by:
  • Self test
404
416}-
417-
418-
419-
420SHELL_VAR *-
421assign_array_var_from_word_list (var, list, flags)-
422 SHELL_VAR *var;-
423 WORD_LIST *list;-
424 int flags;-
425{-
426 register arrayind_t i;-
427 register WORD_LIST *l;-
428 ARRAY *a;-
429-
430 a = (ARRAY *)((var)->value);-
431 i = (
(flags & 0x0001)Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • Self test
flags & 0x0001)
(flags & 0x0001)Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • Self test
? ((a)->max_index) + 1 : 0;
0-25
432-
433 for (l = list; l
lDescription
TRUEevaluated 148 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 25 times by 1 test
Evaluated by:
  • Self test
; l = l->next, i++)
25-148
434 bind_array_var_internal (var, i, 0, l->word->word, flags & ~0x0001);
executed 148 times by 1 test: bind_array_var_internal (var, i, 0, l->word->word, flags & ~0x0001);
Executed by:
  • Self test
148
435-
436 ((var)->attributes &= ~(0x0001000));-
437-
438 return
executed 25 times by 1 test: return var;
Executed by:
  • Self test
var;
executed 25 times by 1 test: return var;
Executed by:
  • Self test
25
439}-
440-
441WORD_LIST *-
442expand_compound_array_assignment (var, value, flags)-
443 SHELL_VAR *var;-
444 char *value;-
445 int flags;-
446{-
447 WORD_LIST *list, *nlist;-
448 char *val;-
449 int ni;-
450-
451-
452-
453-
454 if (*
*value == '('Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 435 times by 1 test
Evaluated by:
  • Self test
value == '('
*value == '('Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 435 times by 1 test
Evaluated by:
  • Self test
)
80-435
455 {-
456 ni = 1;-
457 val = extract_array_assignment_list (value, &ni);-
458 if (val == 0
val == 0Description
TRUEnever evaluated
FALSEevaluated 80 times by 1 test
Evaluated by:
  • Self test
)
0-80
459 return
never executed: return (WORD_LIST *) ((void *)0) ;
(WORD_LIST *)
never executed: return (WORD_LIST *) ((void *)0) ;
0
460 ((void *)0)
never executed: return (WORD_LIST *) ((void *)0) ;
0
461 ;
never executed: return (WORD_LIST *) ((void *)0) ;
0
462 }
executed 80 times by 1 test: end of block
Executed by:
  • Self test
80
463 else-
464 val = value;
executed 435 times by 1 test: val = value;
Executed by:
  • Self test
435
465-
466-
467-
468-
469-
470 list = parse_string_to_word_list (val, 1, "array assign");-
471-
472 if (var
varDescription
TRUEevaluated 515 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 438 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 438 times by 1 test
Evaluated by:
  • Self test
)
0-515
473 {-
474 if (val != value
val != valueDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 65 times by 1 test
Evaluated by:
  • Self test
)
12-65
475 sh_xfree((val), "arrayfunc.c", 483);
executed 12 times by 1 test: sh_xfree((val), "arrayfunc.c", 483);
Executed by:
  • Self test
12
476 return
executed 77 times by 1 test: return list;
Executed by:
  • Self test
list;
executed 77 times by 1 test: return list;
Executed by:
  • Self test
77
477 }-
478-
479-
480-
481-
482-
483 if (list
listDescription
TRUEevaluated 411 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
)
27-411
484 quote_array_assignment_chars (list);
executed 411 times by 1 test: quote_array_assignment_chars (list);
Executed by:
  • Self test
411
485-
486-
487-
488 nlist = list
listDescription
TRUEevaluated 411 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
? expand_words_no_vars (list) : (WORD_LIST *)
27-411
489 ((void *)0)-
490 ;-
491-
492 dispose_words (list);-
493-
494 if (val != value
val != valueDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 369 times by 1 test
Evaluated by:
  • Self test
)
66-369
495 sh_xfree((val), "arrayfunc.c", 501);
executed 66 times by 1 test: sh_xfree((val), "arrayfunc.c", 501);
Executed by:
  • Self test
66
496-
497 return
executed 435 times by 1 test: return nlist;
Executed by:
  • Self test
nlist;
executed 435 times by 1 test: return nlist;
Executed by:
  • Self test
435
498}-
499-
500-
501void-
502assign_compound_array_list (var, nlist, flags)-
503 SHELL_VAR *var;-
504 WORD_LIST *nlist;-
505 int flags;-
506{-
507 ARRAY *a;-
508 HASH_TABLE *h;-
509 WORD_LIST *list;-
510 char *w, *val, *nval, *savecmd;-
511 int len, iflags, free_val;-
512 arrayind_t ind, last_ind;-
513 char *akey;-
514-
515 a = (var
varDescription
TRUEevaluated 512 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 435 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 77 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 435 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 77 times by 1 test
Evaluated by:
  • Self test
) ? (ARRAY *)((var)->value) : (ARRAY *)0;
0-512
516 h = (var
varDescription
TRUEevaluated 512 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 435 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 77 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 435 times by 1 test
Evaluated by:
  • Self test
) ? (HASH_TABLE *)((var)->value) : (HASH_TABLE *)0;
0-512
517-
518 akey = (char *)0;-
519 ind = 0;-
520-
521-
522-
523 if ((
(flags & 0x0001) == 0Description
TRUEevaluated 498 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
flags & 0x0001) == 0
(flags & 0x0001) == 0Description
TRUEevaluated 498 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
)
14-498
524 {-
525 if (a
aDescription
TRUEevaluated 428 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 70 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 428 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 428 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-428
526 array_flush (a);
executed 428 times by 1 test: array_flush (a);
Executed by:
  • Self test
428
527 else if (h
hDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-70
528 assoc_flush (h);
executed 70 times by 1 test: assoc_flush (h);
Executed by:
  • Self test
70
529 }
executed 498 times by 1 test: end of block
Executed by:
  • Self test
498
530-
531 last_ind = (a
aDescription
TRUEevaluated 435 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 77 times by 1 test
Evaluated by:
  • Self test
&& (
(flags & 0x0001)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 428 times by 1 test
Evaluated by:
  • Self test
flags & 0x0001)
(flags & 0x0001)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 428 times by 1 test
Evaluated by:
  • Self test
) ? ((a)->max_index) + 1 : 0;
7-435
532-
533 for (list = nlist; list
listDescription
TRUEevaluated 3173 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 509 times by 1 test
Evaluated by:
  • Self test
; list = list->next)
509-3173
534 {-
535-
536-
537 iflags = flags & ~0x0001;-
538 w = list->word->word;-
539-
540-
541 if ((
(list->word->flags & 0x000004)Description
TRUEevaluated 2108 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1065 times by 1 test
Evaluated by:
  • Self test
list->word->flags & 0x000004)
(list->word->flags & 0x000004)Description
TRUEevaluated 2108 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1065 times by 1 test
Evaluated by:
  • Self test
&& w[0] == '['
w[0] == '['Description
TRUEevaluated 2108 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2108
542 {-
543-
544-
545-
546 len = skipsubscript (w, 0, 0);-
547-
548-
549 if (w[len] != ']'
w[len] != ']'Description
TRUEnever evaluated
FALSEevaluated 2108 times by 1 test
Evaluated by:
  • Self test
|| (w[len+1] != '='
w[len+1] != '='Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2104 times by 1 test
Evaluated by:
  • Self test
&& (w[len+1] != '+'
w[len+1] != '+'Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
|| w[len+2] != '='
w[len+2] != '='Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
)))
0-2108
550 {-
551 if (((((
((((var)->attr... (0x0000040)))Description
TRUEnever evaluated
FALSEnever evaluated
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
552 {-
553 err_badarraysub (w);-
554 continue;
never executed: continue;
0
555 }-
556 nval = make_variable_value (var, w, flags);-
557 if (var->assign_func
var->assign_funcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
558 (*
never executed: (*var->assign_func) (var, nval, last_ind, 0);
var->assign_func) (var, nval, last_ind, 0);
never executed: (*var->assign_func) (var, nval, last_ind, 0);
0
559 else-
560 array_insert (a, last_ind, nval);
never executed: array_insert (a, last_ind, nval);
0
561 do { if (nval
nvalDescription
TRUEnever evaluated
FALSEnever evaluated
) sh_xfree((nval), "arrayfunc.c", 567);
never executed: sh_xfree((nval), "arrayfunc.c", 567);
} while (0);
0
562 last_ind++;-
563 continue;
never executed: continue;
0
564 }-
565-
566 if (len == 1
len == 1Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2098 times by 1 test
Evaluated by:
  • Self test
)
10-2098
567 {-
568 err_badarraysub (w);-
569 continue;
executed 10 times by 1 test: continue;
Executed by:
  • Self test
10
570 }-
571-
572 if (((
(w[1]) == '@'Description
TRUEnever evaluated
FALSEevaluated 2098 times by 1 test
Evaluated by:
  • Self test
w[1]) == '@'
(w[1]) == '@'Description
TRUEnever evaluated
FALSEevaluated 2098 times by 1 test
Evaluated by:
  • Self test
|| (
(w[1]) == '*'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2084 times by 1 test
Evaluated by:
  • Self test
w[1]) == '*'
(w[1]) == '*'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2084 times by 1 test
Evaluated by:
  • Self test
) && len == 2
len == 2Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2098
573 {-
574 last_command_exit_value = 1;-
575 if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test
)
4-10
576 report_error (
executed 4 times by 1 test: report_error ( dcgettext (((void *)0), "%s: invalid associative array key" , 5) , w);
Executed by:
  • Self test
4
577 dcgettext (((void *)0),
executed 4 times by 1 test: report_error ( dcgettext (((void *)0), "%s: invalid associative array key" , 5) , w);
Executed by:
  • Self test
4
578 "%s: invalid associative array key"
executed 4 times by 1 test: report_error ( dcgettext (((void *)0), "%s: invalid associative array key" , 5) , w);
Executed by:
  • Self test
4
579 , 5)
executed 4 times by 1 test: report_error ( dcgettext (((void *)0), "%s: invalid associative array key" , 5) , w);
Executed by:
  • Self test
4
580 , w);
executed 4 times by 1 test: report_error ( dcgettext (((void *)0), "%s: invalid associative array key" , 5) , w);
Executed by:
  • Self test
4
581 else-
582 report_error (
executed 10 times by 1 test: report_error ( dcgettext (((void *)0), "%s: cannot assign to non-numeric index" , 5) , w);
Executed by:
  • Self test
10
583 dcgettext (((void *)0),
executed 10 times by 1 test: report_error ( dcgettext (((void *)0), "%s: cannot assign to non-numeric index" , 5) , w);
Executed by:
  • Self test
10
584 "%s: cannot assign to non-numeric index"
executed 10 times by 1 test: report_error ( dcgettext (((void *)0), "%s: cannot assign to non-numeric index" , 5) , w);
Executed by:
  • Self test
10
585 , 5)
executed 10 times by 1 test: report_error ( dcgettext (((void *)0), "%s: cannot assign to non-numeric index" , 5) , w);
Executed by:
  • Self test
10
586 , w);
executed 10 times by 1 test: report_error ( dcgettext (((void *)0), "%s: cannot assign to non-numeric index" , 5) , w);
Executed by:
  • Self test
10
587 continue;
executed 14 times by 1 test: continue;
Executed by:
  • Self test
14
588 }-
589-
590 if (((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 1928 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 156 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 1928 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 156 times by 1 test
Evaluated by:
  • Self test
)
156-1928
591 {-
592 ind = array_expand_index (var, w + 1, len, 0);-
593-
594 if (ind < 0
ind < 0Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1914 times by 1 test
Evaluated by:
  • Self test
)
11-1914
595 ind = (((ARRAY *)((var)->value))->max_index) + 1 + ind;
executed 11 times by 1 test: ind = (((ARRAY *)((var)->value))->max_index) + 1 + ind;
Executed by:
  • Self test
11
596 if (ind < 0
ind < 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1915 times by 1 test
Evaluated by:
  • Self test
)
10-1915
597 {-
598 err_badarraysub (w);-
599 continue;
executed 10 times by 1 test: continue;
Executed by:
  • Self test
10
600 }-
601-
602 last_ind = ind;-
603 }
executed 1915 times by 1 test: end of block
Executed by:
  • Self test
1915
604 else if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-156
605 {-
606-
607 w[len] = '\0';-
608 akey = expand_assignment_string_to_string (w+1, 0);-
609 w[len] = ']';-
610-
611 if (akey == 0
akey == 0Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • Self test
|| *
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • Self test
akey == 0
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 156 times by 1 test
Evaluated by:
  • Self test
)
0-156
612 {-
613 err_badarraysub (w);-
614 do { if (akey
akeyDescription
TRUEnever evaluated
FALSEnever evaluated
) sh_xfree((akey), "arrayfunc.c", 612);
never executed: sh_xfree((akey), "arrayfunc.c", 612);
} while (0);
0
615 continue;
never executed: continue;
0
616 }-
617 }
executed 156 times by 1 test: end of block
Executed by:
  • Self test
156
618-
619-
620 if (w[len + 1] == '+'
w[len + 1] == '+'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2067 times by 1 test
Evaluated by:
  • Self test
&& w[len + 2] == '='
w[len + 2] == '='Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2067
621 {-
622 iflags |= 0x0001;-
623 val = w + len + 3;-
624 }
executed 4 times by 1 test: end of block
Executed by:
  • Self test
4
625 else-
626 val = w + len + 2;
executed 2067 times by 1 test: val = w + len + 2;
Executed by:
  • Self test
2067
627 }-
628 else if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1050 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1050 times by 1 test
Evaluated by:
  • Self test
)
15-1050
629 {-
630 last_command_exit_value = 1;-
631 report_error (-
632 dcgettext (((void *)0), -
633 "%s: %s: must use subscript when assigning associative array"-
634 , 5)-
635 , var->name, w);-
636 continue;
executed 15 times by 1 test: continue;
Executed by:
  • Self test
15
637 }-
638 else-
639 {-
640 ind = last_ind;-
641 val = w;-
642 }
executed 1050 times by 1 test: end of block
Executed by:
  • Self test
1050
643-
644 free_val = 0;-
645-
646 if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2965 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2965 times by 1 test
Evaluated by:
  • Self test
)
156-2965
647 {-
648 val = expand_assignment_string_to_string (val, 0);-
649 if (val == 0
val == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 151 times by 1 test
Evaluated by:
  • Self test
)
5-151
650 {-
651 val = (char *)sh_xmalloc((1), "arrayfunc.c", 645);-
652 val[0] = '\0';-
653 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test
5
654 free_val = 1;-
655 }
executed 156 times by 1 test: end of block
Executed by:
  • Self test
156
656-
657 savecmd = this_command_name;-
658 if (((((
((((var)->attr... (0x0000010)))Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3066 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000010)))
((((var)->attr... (0x0000010)))Description
TRUEevaluated 55 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3066 times by 1 test
Evaluated by:
  • Self test
)
55-3066
659 this_command_name = (char *)
executed 55 times by 1 test: this_command_name = (char *) ((void *)0) ;
Executed by:
  • Self test
55
660 ((void *)0)
executed 55 times by 1 test: this_command_name = (char *) ((void *)0) ;
Executed by:
  • Self test
55
661 ;
executed 55 times by 1 test: this_command_name = (char *) ((void *)0) ;
Executed by:
  • Self test
55
662 bind_array_var_internal (var, ind, akey, val, iflags);-
663 last_ind++;-
664 this_command_name = savecmd;-
665-
666 if (free_val
free_valDescription
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2965 times by 1 test
Evaluated by:
  • Self test
)
156-2965
667 sh_xfree((val), "arrayfunc.c", 659);
executed 156 times by 1 test: sh_xfree((val), "arrayfunc.c", 659);
Executed by:
  • Self test
156
668 }
executed 3121 times by 1 test: end of block
Executed by:
  • Self test
3121
669}
executed 509 times by 1 test: end of block
Executed by:
  • Self test
509
670-
671-
672-
673SHELL_VAR *-
674assign_array_var_from_string (var, value, flags)-
675 SHELL_VAR *var;-
676 char *value;-
677 int flags;-
678{-
679 WORD_LIST *nlist;-
680-
681 if (value == 0
value == 0Description
TRUEnever evaluated
FALSEevaluated 484 times by 1 test
Evaluated by:
  • Self test
)
0-484
682 return
never executed: return var;
var;
never executed: return var;
0
683-
684 nlist = expand_compound_array_assignment (var, value, flags);-
685 assign_compound_array_list (var, nlist, flags);-
686-
687 if (nlist
nlistDescription
TRUEevaluated 448 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test
)
30-448
688 dispose_words (nlist);
executed 448 times by 1 test: dispose_words (nlist);
Executed by:
  • Self test
448
689-
690 if (var
varDescription
TRUEevaluated 478 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-478
691 ((
executed 478 times by 1 test: ((var)->attributes &= ~(0x0001000));
Executed by:
  • Self test
var)->attributes &= ~(0x0001000));
executed 478 times by 1 test: ((var)->attributes &= ~(0x0001000));
Executed by:
  • Self test
478
692-
693 return
executed 478 times by 1 test: return (var);
Executed by:
  • Self test
(var);
executed 478 times by 1 test: return (var);
Executed by:
  • Self test
478
694}-
695-
696-
697-
698-
699static char *-
700quote_assign (string)-
701 const char *string;-
702{-
703 size_t slen;-
704 int saw_eq;-
705 char *temp, *t, *subs;-
706 const char *s, *send;-
707 int ss, se;-
708 mbstate_t state; memset (&state, '\0', sizeof (mbstate_t));-
709-
710 slen = strlen (string);-
711 send = string + slen;-
712-
713 t = temp = (char *)sh_xmalloc((slen * 2 + 1), "arrayfunc.c", 705);-
714 saw_eq = 0;-
715 for (s = string; *
*sDescription
TRUEevaluated 9911 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
s
*sDescription
TRUEevaluated 9911 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
; )
1952-9911
716 {-
717 if (*
*s == '='Description
TRUEevaluated 1955 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7956 times by 1 test
Evaluated by:
  • Self test
s == '='
*s == '='Description
TRUEevaluated 1955 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7956 times by 1 test
Evaluated by:
  • Self test
)
1955-7956
718 saw_eq = 1;
executed 1955 times by 1 test: saw_eq = 1;
Executed by:
  • Self test
1955
719 if (saw_eq == 0
saw_eq == 0Description
TRUEevaluated 1954 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7957 times by 1 test
Evaluated by:
  • Self test
&& *
*s == '['Description
TRUEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
s == '['
*s == '['Description
TRUEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
2-7957
720 {-
721 ss = s - string;-
722 se = skipsubscript (string, ss, 0);-
723 subs = substring (s, ss, se);-
724 *t++ = '\\';-
725 strcpy (t, subs);-
726 t += se - ss;-
727 *t++ = '\\';-
728 *t++ = ']';-
729 s += se + 1;-
730 sh_xfree((subs), "arrayfunc.c", 722);-
731 continue;
executed 1952 times by 1 test: continue;
Executed by:
  • Self test
1952
732 }-
733 if (saw_eq == 0
saw_eq == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7957 times by 1 test
Evaluated by:
  • Self test
&& (glob_char_p (s)
glob_char_p (s)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
|| (
(ifs_cmap[(uns...ar)(*s)] != 0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
ifs_cmap[(unsigned char)(*s)] != 0)
(ifs_cmap[(uns...ar)(*s)] != 0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
))
0-7957
734 *
never executed: *t++ = '\\';
t++ = '\\';
never executed: *t++ = '\\';
0
735-
736 do { if (locale_mb_cur_max > 1
locale_mb_cur_max > 1Description
TRUEevaluated 7959 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) { mbstate_t state_bak; size_t mblength; int _k; _k = is_basic (*(s)); if (_k
_kDescription
TRUEevaluated 6438 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1521 times by 1 test
Evaluated by:
  • Self test
) mblength = 1;
executed 6438 times by 1 test: mblength = 1;
Executed by:
  • Self test
else if (locale_utf8locale
locale_utf8localeDescription
TRUEevaluated 1521 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((*(
((*(s) & 0x80) == 0)Description
TRUEevaluated 131 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1390 times by 1 test
Evaluated by:
  • Self test
s) & 0x80) == 0)
((*(s) & 0x80) == 0)Description
TRUEevaluated 131 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1390 times by 1 test
Evaluated by:
  • Self test
) mblength = 1;
executed 131 times by 1 test: mblength = 1;
Executed by:
  • Self test
else { state_bak = state; mblength = mbrlen ((s), (send) - (s), &state); }
executed 1390 times by 1 test: end of block
Executed by:
  • Self test
if (mblength == (size_t)-2
mblength == (size_t)-2Description
TRUEnever evaluated
FALSEevaluated 7959 times by 1 test
Evaluated by:
  • Self test
|| mblength == (size_t)-1
mblength == (size_t)-1Description
TRUEevaluated 199 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7760 times by 1 test
Evaluated by:
  • Self test
) { state = state_bak; mblength = 1; }
executed 199 times by 1 test: end of block
Executed by:
  • Self test
else mblength = (
(mblength < 1)Description
TRUEnever evaluated
FALSEevaluated 7760 times by 1 test
Evaluated by:
  • Self test
mblength < 1)
(mblength < 1)Description
TRUEnever evaluated
FALSEevaluated 7760 times by 1 test
Evaluated by:
  • Self test
? 1 : mblength;
executed 7760 times by 1 test: mblength = (mblength < 1) ? 1 : mblength;
Executed by:
  • Self test
for (_k = 0; _k < mblength
_k < mblengthDescription
TRUEevaluated 9946 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7959 times by 1 test
Evaluated by:
  • Self test
; _k++) *(
executed 9946 times by 1 test: *(t)++ = *(s)++;
Executed by:
  • Self test
t)++ = *(s)++;
executed 9946 times by 1 test: *(t)++ = *(s)++;
Executed by:
  • Self test
}
executed 7959 times by 1 test: end of block
Executed by:
  • Self test
else *(
never executed: *(t)++ = *(s)++;
t)++ = *(s)++;
never executed: *(t)++ = *(s)++;
} while (0);
0-9946
737 }
executed 7959 times by 1 test: end of block
Executed by:
  • Self test
7959
738 *t = '\0';-
739 return
executed 1952 times by 1 test: return temp;
Executed by:
  • Self test
temp;
executed 1952 times by 1 test: return temp;
Executed by:
  • Self test
1952
740}-
741-
742-
743-
744static void-
745quote_array_assignment_chars (list)-
746 WORD_LIST *list;-
747{-
748 char *nword;-
749 WORD_LIST *l;-
750-
751 for (l = list; l
lDescription
TRUEevaluated 2815 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 411 times by 1 test
Evaluated by:
  • Self test
; l = l->next)
411-2815
752 {-
753 if (l->word == 0
l->word == 0Description
TRUEnever evaluated
FALSEevaluated 2815 times by 1 test
Evaluated by:
  • Self test
|| l->word->word == 0
l->word->word == 0Description
TRUEnever evaluated
FALSEevaluated 2815 times by 1 test
Evaluated by:
  • Self test
|| l->word->word[0] == '\0'
l->word->word[0] == '\0'Description
TRUEnever evaluated
FALSEevaluated 2815 times by 1 test
Evaluated by:
  • Self test
)
0-2815
754 continue;
never executed: continue;
0
755-
756-
757 if ((
(l->word->flag...0x000004) == 0Description
TRUEevaluated 863 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
l->word->flags & 0x000004) == 0
(l->word->flag...0x000004) == 0Description
TRUEevaluated 863 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
)
863-1952
758 continue;
executed 863 times by 1 test: continue;
Executed by:
  • Self test
863
759 if (l->word->word[0] != '['
l->word->word[0] != '['Description
TRUEnever evaluated
FALSEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
|| mbschr (l->word->word, '=') == 0
mbschr (l->wor...ord, '=') == 0Description
TRUEnever evaluated
FALSEevaluated 1952 times by 1 test
Evaluated by:
  • Self test
)
0-1952
760 continue;
never executed: continue;
0
761-
762 nword = quote_assign (l->word->word);-
763 sh_xfree((l->word->word), "arrayfunc.c", 755);-
764 l->word->word = nword;-
765 l->word->flags |= 0x000020;-
766 }
executed 1952 times by 1 test: end of block
Executed by:
  • Self test
1952
767}
executed 411 times by 1 test: end of block
Executed by:
  • Self test
411
768-
769-
770-
771-
772-
773-
774-
775int-
776unbind_array_element (var, sub, flags)-
777 SHELL_VAR *var;-
778 char *sub;-
779 int flags;-
780{-
781 int len;-
782 arrayind_t ind;-
783 char *akey;-
784 ARRAY_ELEMENT *ae;-
785-
786 len = skipsubscript (sub, 0, (flags&1) || (var && ((((var)->attributes) & (0x0000040)))));-
787 if (sub[len] != ']'
sub[len] != ']'Description
TRUEnever evaluated
FALSEevaluated 112 times by 1 test
Evaluated by:
  • Self test
|| len == 0
len == 0Description
TRUEnever evaluated
FALSEevaluated 112 times by 1 test
Evaluated by:
  • Self test
)
0-112
788 {-
789 builtin_error ("%s[%s: %s", var->name, sub, -
790 dcgettext (((void *)0), -
791 bash_badsub_errmsg-
792 , 5)-
793 );-
794 return
never executed: return -1;
-1;
never executed: return -1;
0
795 }-
796 sub[len] = '\0';-
797-
798 if (((
(sub[0]) == '@'Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 109 times by 1 test
Evaluated by:
  • Self test
sub[0]) == '@'
(sub[0]) == '@'Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 109 times by 1 test
Evaluated by:
  • Self test
|| (
(sub[0]) == '*'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 99 times by 1 test
Evaluated by:
  • Self test
sub[0]) == '*'
(sub[0]) == '*'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 99 times by 1 test
Evaluated by:
  • Self test
) && sub[1] == 0
sub[1] == 0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-109
799 {-
800 if (((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-11
801 {-
802 unbind_variable (var->name);-
803 return
executed 13 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 13 times by 1 test: return (0);
Executed by:
  • Self test
13
804 }-
805 else-
806 return
never executed: return -2;
-2;
never executed: return -2;
0
807 }-
808-
809 if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 90 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 90 times by 1 test
Evaluated by:
  • Self test
)
9-90
810 {-
811 akey = (
(flags & 1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
flags & 1)
(flags & 1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
? sub : expand_assignment_string_to_string (sub, 0);
4-5
812 if (akey == 0
akey == 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
|| *
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
akey == 0
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
)
0-9
813 {-
814 builtin_error ("[%s]: %s", sub, -
815 dcgettext (((void *)0), -
816 bash_badsub_errmsg-
817 , 5)-
818 );-
819 do { if (akey
akeyDescription
TRUEnever evaluated
FALSEnever evaluated
) sh_xfree((akey), "arrayfunc.c", 803);
never executed: sh_xfree((akey), "arrayfunc.c", 803);
} while (0);
0
820 return
never executed: return -1;
-1;
never executed: return -1;
0
821 }-
822 assoc_remove ((HASH_TABLE *)((var)->value), akey);-
823 if (akey != sub
akey != subDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
)
4-5
824 sh_xfree((akey), "arrayfunc.c", 808);
executed 5 times by 1 test: sh_xfree((akey), "arrayfunc.c", 808);
Executed by:
  • Self test
5
825 }
executed 9 times by 1 test: end of block
Executed by:
  • Self test
9
826 else if (((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test
)
11-79
827 {-
828 ind = array_expand_index (var, sub, len+1, 0);-
829-
830 if (ind < 0
ind < 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 71 times by 1 test
Evaluated by:
  • Self test
)
8-71
831 ind = (((ARRAY *)((var)->value))->max_index) + 1 + ind;
executed 8 times by 1 test: ind = (((ARRAY *)((var)->value))->max_index) + 1 + ind;
Executed by:
  • Self test
8
832 if (ind < 0
ind < 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 73 times by 1 test
Evaluated by:
  • Self test
)
6-73
833 {-
834 builtin_error ("[%s]: %s", sub, -
835 dcgettext (((void *)0), -
836 bash_badsub_errmsg-
837 , 5)-
838 );-
839 return
executed 6 times by 1 test: return -1;
Executed by:
  • Self test
-1;
executed 6 times by 1 test: return -1;
Executed by:
  • Self test
6
840 }-
841 ae = array_remove ((ARRAY *)((var)->value), ind);-
842 if (ae
aeDescription
TRUEevaluated 35 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
)
35-38
843 array_dispose_element (ae);
executed 35 times by 1 test: array_dispose_element (ae);
Executed by:
  • Self test
35
844 }
executed 73 times by 1 test: end of block
Executed by:
  • Self test
73
845 else-
846 {-
847 akey = this_command_name;-
848 ind = array_expand_index (var, sub, len+1, 0);-
849 this_command_name = akey;-
850 if (ind == 0
ind == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test
)
1-10
851 {-
852 unbind_variable (var->name);-
853 return
executed 1 time by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 1 time by 1 test: return (0);
Executed by:
  • Self test
1
854 }-
855 else-
856 return
executed 10 times by 1 test: return -2;
Executed by:
  • Self test
-2;
executed 10 times by 1 test: return -2;
Executed by:
  • Self test
10
857 }-
858-
859 return
executed 82 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 82 times by 1 test: return 0;
Executed by:
  • Self test
82
860}-
861-
862-
863-
864void-
865print_array_assignment (var, quoted)-
866 SHELL_VAR *var;-
867 int quoted;-
868{-
869 char *vstr;-
870-
871 vstr = array_to_assign ((ARRAY *)((var)->value), quoted);-
872-
873 if (vstr == 0
vstr == 0Description
TRUEevaluated 49 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 224 times by 1 test
Evaluated by:
  • Self test
)
49-224
874 printf ("%s=%s\n", var->name, quoted ? "'()'" : "()");
executed 49 times by 1 test: printf ("%s=%s\n", var->name, quoted ? "'()'" : "()");
Executed by:
  • Self test
49
875 else-
876 {-
877 printf ("%s=%s\n", var->name, vstr);-
878 sh_xfree((vstr), "arrayfunc.c", 858);-
879 }
executed 224 times by 1 test: end of block
Executed by:
  • Self test
224
880}-
881-
882-
883-
884void-
885print_assoc_assignment (var, quoted)-
886 SHELL_VAR *var;-
887 int quoted;-
888{-
889 char *vstr;-
890-
891 vstr = assoc_to_assign ((HASH_TABLE *)((var)->value), quoted);-
892-
893 if (vstr == 0
vstr == 0Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 85 times by 1 test
Evaluated by:
  • Self test
)
34-85
894 printf ("%s=%s\n", var->name, quoted ? "'()'" : "()");
executed 34 times by 1 test: printf ("%s=%s\n", var->name, quoted ? "'()'" : "()");
Executed by:
  • Self test
34
895 else-
896 {-
897 printf ("%s=%s\n", var->name, vstr);-
898 sh_xfree((vstr), "arrayfunc.c", 878);-
899 }
executed 85 times by 1 test: end of block
Executed by:
  • Self test
85
900}-
901int-
902valid_array_reference (name, flags)-
903 const char *name;-
904 int flags;-
905{-
906 char *t;-
907 int r, len;-
908-
909 t = mbschr (name, '[');-
910 if (t
tDescription
TRUEevaluated 35206 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17891781 times by 1 test
Evaluated by:
  • Self test
)
35206-17891781
911 {-
912 *t = '\0';-
913 r = legal_identifier (name);-
914 *t = '[';-
915 if (r == 0
r == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35203 times by 1 test
Evaluated by:
  • Self test
)
3-35203
916 return
executed 3 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 3 times by 1 test: return 0;
Executed by:
  • Self test
3
917-
918 len = skipsubscript (t, 0, flags);-
919 if (t[len] != ']'
t[len] != ']'Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35194 times by 1 test
Evaluated by:
  • Self test
|| len == 1
len == 1Description
TRUEnever evaluated
FALSEevaluated 35194 times by 1 test
Evaluated by:
  • Self test
)
0-35194
920 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
921 if (t[len+1] != '\0'
t[len+1] != '\0'Description
TRUEnever evaluated
FALSEevaluated 35194 times by 1 test
Evaluated by:
  • Self test
)
0-35194
922 return
never executed: return 0;
0;
never executed: return 0;
0
923-
924-
925-
926 for (r = 1; r < len
r < lenDescription
TRUEevaluated 35232 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test
; r++)
30-35232
927 if ((((
((t[r]) == ' ')Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35164 times by 1 test
Evaluated by:
  • Self test
t[r]) == ' ')
((t[r]) == ' ')Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 35164 times by 1 test
Evaluated by:
  • Self test
|| ((
((t[r]) == '\t')Description
TRUEnever evaluated
FALSEevaluated 35164 times by 1 test
Evaluated by:
  • Self test
t[r]) == '\t')
((t[r]) == '\t')Description
TRUEnever evaluated
FALSEevaluated 35164 times by 1 test
Evaluated by:
  • Self test
) == 0
(((t[r]) == ' ...== '\t')) == 0Description
TRUEevaluated 35164 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 68 times by 1 test
Evaluated by:
  • Self test
)
0-35164
928 return
executed 35164 times by 1 test: return 1;
Executed by:
  • Self test
1;
executed 35164 times by 1 test: return 1;
Executed by:
  • Self test
35164
929 return
executed 30 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 30 times by 1 test: return 0;
Executed by:
  • Self test
30
930-
931-
932-
933-
934 }-
935 return
executed 17891781 times by 1 test: return 0;
Executed by:
  • Self test
0;
executed 17891781 times by 1 test: return 0;
Executed by:
  • Self test
17891781
936}-
937-
938-
939arrayind_t-
940array_expand_index (var, s, len, flags)-
941 SHELL_VAR *var;-
942 char *s;-
943 int len;-
944 int flags;-
945{-
946 char *exp, *t, *savecmd;-
947 int expok;-
948 arrayind_t val;-
949-
950 exp = (char *)sh_xmalloc((len), "arrayfunc.c", 938);-
951 -
952 __builtin_strncpy (-
953 exp-
954 , -
955 s-
956 , -
957 len - 1-
958 )-
959 ;-
960 exp[len - 1] = '\0';-
961-
962-
963-
964-
965-
966-
967 t = expand_arith_string (exp, 0x001|0x100|0x200);-
968 savecmd = this_command_name;-
969 this_command_name = (char *)-
970 ((void *)0)-
971 ;-
972 val = evalexp (t, 0, &expok);-
973 this_command_name = savecmd;-
974 if (t != exp
t != expDescription
TRUEevaluated 27600 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-27600
975 sh_xfree((t), "arrayfunc.c", 953);
executed 27600 times by 1 test: sh_xfree((t), "arrayfunc.c", 953);
Executed by:
  • Self test
27600
976 sh_xfree((exp), "arrayfunc.c", 954);-
977 if (expok == 0
expok == 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27588 times by 1 test
Evaluated by:
  • Self test
)
12-27588
978 {-
979 last_command_exit_value = 1;-
980-
981 if (no_longjmp_on_fatal_error
no_longjmp_on_fatal_errorDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test
)
0-12
982 return
never executed: return 0;
0;
never executed: return 0;
0
983 top_level_cleanup ();-
984 jump_to_top_level (2);-
985 }
never executed: end of block
0
986 return
executed 27588 times by 1 test: return val;
Executed by:
  • Self test
val;
executed 27588 times by 1 test: return val;
Executed by:
  • Self test
27588
987}-
988-
989-
990-
991-
992-
993char *-
994array_variable_name (s, flags, subp, lenp)-
995 const char *s;-
996 int flags;-
997 char **subp;-
998 int *lenp;-
999{-
1000 char *t, *ret;-
1001 int ind, ni;-
1002-
1003 t = mbschr (s, '[');-
1004 if (t == 0
t == 0Description
TRUEnever evaluated
FALSEevaluated 64120 times by 1 test
Evaluated by:
  • Self test
)
0-64120
1005 {-
1006 if (subp
subpDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1007 *
never executed: *subp = t;
subp = t;
never executed: *subp = t;
0
1008 if (lenp
lenpDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1009 *
never executed: *lenp = 0;
lenp = 0;
never executed: *lenp = 0;
0
1010 return
never executed: return ((char *) ((void *)0) );
((char *)
never executed: return ((char *) ((void *)0) );
0
1011 ((void *)0)
never executed: return ((char *) ((void *)0) );
0
1012 );
never executed: return ((char *) ((void *)0) );
0
1013 }-
1014 ind = t - s;-
1015 ni = skipsubscript (s, ind, flags);-
1016 if (ni <= ind + 1
ni <= ind + 1Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 64109 times by 1 test
Evaluated by:
  • Self test
|| s[ni] != ']'
s[ni] != ']'Description
TRUEnever evaluated
FALSEevaluated 64109 times by 1 test
Evaluated by:
  • Self test
)
0-64109
1017 {-
1018 err_badarraysub (s);-
1019 if (subp
subpDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-11
1020 *
executed 11 times by 1 test: *subp = t;
Executed by:
  • Self test
subp = t;
executed 11 times by 1 test: *subp = t;
Executed by:
  • Self test
11
1021 if (lenp
lenpDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-11
1022 *
executed 11 times by 1 test: *lenp = 0;
Executed by:
  • Self test
lenp = 0;
executed 11 times by 1 test: *lenp = 0;
Executed by:
  • Self test
11
1023 return
executed 11 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
((char *)
executed 11 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
11
1024 ((void *)0)
executed 11 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
11
1025 );
executed 11 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
11
1026 }-
1027-
1028 *t = '\0';-
1029 ret = (char *)strcpy (sh_xmalloc((1 + strlen (s)), "arrayfunc.c", 1003), (s));-
1030 *t++ = '[';-
1031-
1032 if (subp
subpDescription
TRUEevaluated 33858 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 30251 times by 1 test
Evaluated by:
  • Self test
)
30251-33858
1033 *
executed 33858 times by 1 test: *subp = t;
Executed by:
  • Self test
subp = t;
executed 33858 times by 1 test: *subp = t;
Executed by:
  • Self test
33858
1034 if (lenp
lenpDescription
TRUEevaluated 27300 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 36809 times by 1 test
Evaluated by:
  • Self test
)
27300-36809
1035 *
executed 27300 times by 1 test: *lenp = ni - ind;
Executed by:
  • Self test
lenp = ni - ind;
executed 27300 times by 1 test: *lenp = ni - ind;
Executed by:
  • Self test
27300
1036-
1037 return
executed 64109 times by 1 test: return ret;
Executed by:
  • Self test
ret;
executed 64109 times by 1 test: return ret;
Executed by:
  • Self test
64109
1038}-
1039-
1040-
1041-
1042-
1043SHELL_VAR *-
1044array_variable_part (s, flags, subp, lenp)-
1045 const char *s;-
1046 int flags;-
1047 char **subp;-
1048 int *lenp;-
1049{-
1050 char *t;-
1051 SHELL_VAR *var;-
1052-
1053 t = array_variable_name (s, flags, subp, lenp);-
1054 if (t == 0
t == 0Description
TRUEnever evaluated
FALSEevaluated 43180 times by 1 test
Evaluated by:
  • Self test
)
0-43180
1055 return
never executed: return ((SHELL_VAR *) ((void *)0) );
((SHELL_VAR *)
never executed: return ((SHELL_VAR *) ((void *)0) );
0
1056 ((void *)0)
never executed: return ((SHELL_VAR *) ((void *)0) );
0
1057 );
never executed: return ((SHELL_VAR *) ((void *)0) );
0
1058 var = find_variable (t);-
1059-
1060 sh_xfree((t), "arrayfunc.c", 1032);-
1061 return
executed 43180 times by 1 test: return var;
Executed by:
  • Self test
var;
executed 43180 times by 1 test: return var;
Executed by:
  • Self test
43180
1062}-
1063static char *-
1064array_value_internal (s, quoted, flags, rtype, indp)-
1065 const char *s;-
1066 int quoted, flags, *rtype;-
1067 arrayind_t *indp;-
1068{-
1069 int len;-
1070 arrayind_t ind;-
1071 char *akey;-
1072 char *retval, *t, *temp;-
1073 WORD_LIST *l;-
1074 SHELL_VAR *var;-
1075-
1076 var = array_variable_part (s, (flags&0x020) ? 1 : 0, &t, &len);-
1077 if (len == 0
len == 0Description
TRUEnever evaluated
FALSEevaluated 16207 times by 1 test
Evaluated by:
  • Self test
)
0-16207
1078 return
never executed: return ((char *) ((void *)0) );
((char *)
never executed: return ((char *) ((void *)0) );
0
1079 ((void *)0)
never executed: return ((char *) ((void *)0) );
0
1080 );
never executed: return ((char *) ((void *)0) );
0
1081-
1082-
1083 akey = 0;-
1084 if (((
(t[0]) == '@'Description
TRUEevaluated 672 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15535 times by 1 test
Evaluated by:
  • Self test
t[0]) == '@'
(t[0]) == '@'Description
TRUEevaluated 672 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15535 times by 1 test
Evaluated by:
  • Self test
|| (
(t[0]) == '*'Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15379 times by 1 test
Evaluated by:
  • Self test
t[0]) == '*'
(t[0]) == '*'Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15379 times by 1 test
Evaluated by:
  • Self test
) && t[1] == ']'
t[1] == ']'Description
TRUEevaluated 828 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-15535
1085 {-
1086 if (rtype
rtypeDescription
TRUEevaluated 828 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-828
1087 *
executed 828 times by 1 test: *rtype = (t[0] == '*') ? 1 : 2;
Executed by:
  • Self test
rtype = (
(t[0] == '*')Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 672 times by 1 test
Evaluated by:
  • Self test
t[0] == '*')
(t[0] == '*')Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 672 times by 1 test
Evaluated by:
  • Self test
? 1 : 2;
executed 828 times by 1 test: *rtype = (t[0] == '*') ? 1 : 2;
Executed by:
  • Self test
156-828
1088 if ((
(flags & 0x001) == 0Description
TRUEnever evaluated
FALSEevaluated 828 times by 1 test
Evaluated by:
  • Self test
flags & 0x001) == 0
(flags & 0x001) == 0Description
TRUEnever evaluated
FALSEevaluated 828 times by 1 test
Evaluated by:
  • Self test
)
0-828
1089 {-
1090 err_badarraysub (s);-
1091 return
never executed: return ((char *) ((void *)0) );
((char *)
never executed: return ((char *) ((void *)0) );
0
1092 ((void *)0)
never executed: return ((char *) ((void *)0) );
0
1093 );
never executed: return ((char *) ((void *)0) );
0
1094 }-
1095 else if (var == 0
var == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 823 times by 1 test
Evaluated by:
  • Self test
|| ((
((var)->value) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 821 times by 1 test
Evaluated by:
  • Self test
var)->value) == 0
((var)->value) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 821 times by 1 test
Evaluated by:
  • Self test
)
2-823
1096 return
executed 7 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
((char *)
executed 7 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
7
1097 ((void *)0)
executed 7 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
7
1098 );
executed 7 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
7
1099 else if (((((
((((var)->attr...000004))) == 0Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 727 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004))) == 0
((((var)->attr...000004))) == 0Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 727 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr...000040))) == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 85 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040))) == 0
((((var)->attr...000040))) == 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 85 times by 1 test
Evaluated by:
  • Self test
)
9-727
1100 l = make_word_list (make_word(((var)->value)), ((WORD_LIST *)
executed 9 times by 1 test: l = make_word_list (make_word(((var)->value)), ((WORD_LIST *) ((void *)0) ));
Executed by:
  • Self test
9
1101 ((void *)0)
executed 9 times by 1 test: l = make_word_list (make_word(((var)->value)), ((WORD_LIST *) ((void *)0) ));
Executed by:
  • Self test
9
1102 ));
executed 9 times by 1 test: l = make_word_list (make_word(((var)->value)), ((WORD_LIST *) ((void *)0) ));
Executed by:
  • Self test
9
1103 else if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 85 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 727 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 85 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 727 times by 1 test
Evaluated by:
  • Self test
)
85-727
1104 {-
1105 l = assoc_to_word_list ((HASH_TABLE *)((var)->value));-
1106 if (l == (WORD_LIST *)
l == (WORD_LIST *) ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 84 times by 1 test
Evaluated by:
  • Self test
1-84
1107 ((void *)0)
l == (WORD_LIST *) ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 84 times by 1 test
Evaluated by:
  • Self test
1-84
1108 )-
1109 return
executed 1 time by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
((char *)
executed 1 time by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
1
1110 ((void *)0)
executed 1 time by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
1
1111 );
executed 1 time by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
1
1112 }
executed 84 times by 1 test: end of block
Executed by:
  • Self test
84
1113 else-
1114 {-
1115 l = array_to_word_list ((ARRAY *)((var)->value));-
1116 if (l == (WORD_LIST *)
l == (WORD_LIST *) ((void *)0)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 701 times by 1 test
Evaluated by:
  • Self test
26-701
1117 ((void *)0)
l == (WORD_LIST *) ((void *)0)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 701 times by 1 test
Evaluated by:
  • Self test
26-701
1118 )-
1119 return
executed 26 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
((char *)
executed 26 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
26
1120 ((void *)0)
executed 26 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
26
1121 );
executed 26 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
26
1122 }
executed 701 times by 1 test: end of block
Executed by:
  • Self test
701
1123-
1124-
1125-
1126 if (t[0] == '*'
t[0] == '*'Description
TRUEevaluated 156 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 638 times by 1 test
Evaluated by:
  • Self test
&& (
(quoted & (0x002|0x001))Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 106 times by 1 test
Evaluated by:
  • Self test
quoted & (0x002|0x001))
(quoted & (0x002|0x001))Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 106 times by 1 test
Evaluated by:
  • Self test
)
50-638
1127 {-
1128 temp = string_list_dollar_star (l, quoted, (flags & 0x010) ? 0x08 : 0);-
1129 retval = quote_string (temp);-
1130 sh_xfree((temp), "arrayfunc.c", 1115);-
1131 }
executed 50 times by 1 test: end of block
Executed by:
  • Self test
50
1132 else-
1133-
1134 retval = string_list_dollar_at (l, quoted, (flags & 0x010) ? 0x08 : 0);
executed 744 times by 1 test: retval = string_list_dollar_at (l, quoted, (flags & 0x010) ? 0x08 : 0);
Executed by:
  • Self test
744
1135-
1136 dispose_words (l);-
1137 }
executed 794 times by 1 test: end of block
Executed by:
  • Self test
794
1138 else-
1139 {-
1140 if (rtype
rtypeDescription
TRUEevaluated 5124 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 10255 times by 1 test
Evaluated by:
  • Self test
)
5124-10255
1141 *
executed 5124 times by 1 test: *rtype = 0;
Executed by:
  • Self test
rtype = 0;
executed 5124 times by 1 test: *rtype = 0;
Executed by:
  • Self test
5124
1142 if (var == 0
var == 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15367 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 15240 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 127 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 15240 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 127 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((var)->attr...000040))) == 0Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040))) == 0
((((var)->attr...000040))) == 0Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
)
12-15367
1143 {-
1144 if ((
(flags & 0x004) == 0Description
TRUEevaluated 15174 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 141 times by 1 test
Evaluated by:
  • Self test
flags & 0x004) == 0
(flags & 0x004) == 0Description
TRUEevaluated 15174 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 141 times by 1 test
Evaluated by:
  • Self test
|| indp == 0
indp == 0Description
TRUEnever evaluated
FALSEevaluated 141 times by 1 test
Evaluated by:
  • Self test
)
0-15174
1145 {-
1146 ind = array_expand_index (var, t, len, flags);-
1147 if (ind < 0
ind < 0Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15147 times by 1 test
Evaluated by:
  • Self test
)
11-15147
1148 {-
1149-
1150 if (var
varDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& ((((
((((var)->attr... (0x0000004)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-11
1151 ind = (((ARRAY *)((var)->value))->max_index) + 1 + ind;
executed 11 times by 1 test: ind = (((ARRAY *)((var)->value))->max_index) + 1 + ind;
Executed by:
  • Self test
11
1152 if (ind < 0
ind < 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
1-10
1153 do { if (var
varDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) err_badarraysub (var->name);
executed 10 times by 1 test: err_badarraysub (var->name);
Executed by:
  • Self test
else { t[-1] = '\0'; err_badarraysub (s); t[-1] = '['; }
never executed: end of block
return
executed 10 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
((char *)
executed 10 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
0-10
1154 ((void *)0)
executed 10 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
10
1155 );
executed 10 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
}
never executed: end of block
while (0);
0-10
1156 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test
1
1157 if (indp
indpDescription
TRUEevaluated 15143 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
5-15143
1158 *
executed 15143 times by 1 test: *indp = ind;
Executed by:
  • Self test
indp = ind;
executed 15143 times by 1 test: *indp = ind;
Executed by:
  • Self test
15143
1159 }
executed 15148 times by 1 test: end of block
Executed by:
  • Self test
15148
1160 else if (indp
indpDescription
TRUEevaluated 141 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-141
1161 ind = *indp;
executed 141 times by 1 test: ind = *indp;
Executed by:
  • Self test
141
1162 }
executed 15289 times by 1 test: end of block
Executed by:
  • Self test
15289
1163 else if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-64
1164 {-
1165 t[len - 1] = '\0';-
1166 if ((
(flags & 0x020) == 0Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
flags & 0x020) == 0
(flags & 0x020) == 0Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
)
7-57
1167 akey = expand_assignment_string_to_string (t, 0);
executed 57 times by 1 test: akey = expand_assignment_string_to_string (t, 0);
Executed by:
  • Self test
57
1168 else-
1169 akey = (char *)strcpy (sh_xmalloc((1 + strlen (t)), "arrayfunc.c", 1152), (t));
executed 7 times by 1 test: akey = (char *)strcpy (sh_xmalloc((1 + strlen (t)), "arrayfunc.c", 1152), (t));
Executed by:
  • Self test
7
1170 t[len - 1] = ']';-
1171 if (akey == 0
akey == 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
|| *
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
akey == 0
*akey == 0Description
TRUEnever evaluated
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
)
0-64
1172 {-
1173 do { if (akey
akeyDescription
TRUEnever evaluated
FALSEnever evaluated
) sh_xfree((akey), "arrayfunc.c", 1156);
never executed: sh_xfree((akey), "arrayfunc.c", 1156);
} while (0);
0
1174 do { if (var
varDescription
TRUEnever evaluated
FALSEnever evaluated
) err_badarraysub (var->name);
never executed: err_badarraysub (var->name);
else { t[-1] = '\0'; err_badarraysub (s); t[-1] = '['; }
never executed: end of block
return
never executed: return ((char *) ((void *)0) );
((char *)
never executed: return ((char *) ((void *)0) );
0
1175 ((void *)0)
never executed: return ((char *) ((void *)0) );
0
1176 );
never executed: return ((char *) ((void *)0) );
} while (0);
0
1177 }-
1178 }
executed 64 times by 1 test: end of block
Executed by:
  • Self test
64
1179-
1180 if (var == 0
var == 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15341 times by 1 test
Evaluated by:
  • Self test
|| ((
((var)->value) == 0Description
TRUEnever evaluated
FALSEevaluated 15341 times by 1 test
Evaluated by:
  • Self test
var)->value) == 0
((var)->value) == 0Description
TRUEnever evaluated
FALSEevaluated 15341 times by 1 test
Evaluated by:
  • Self test
)
0-15341
1181 {-
1182 do { if (akey
akeyDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test
) sh_xfree((akey), "arrayfunc.c", 1163);
never executed: sh_xfree((akey), "arrayfunc.c", 1163);
} while (0);
0-12
1183 return
executed 12 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
((char *)
executed 12 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
12
1184 ((void *)0)
executed 12 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
12
1185 );
executed 12 times by 1 test: return ((char *) ((void *)0) );
Executed by:
  • Self test
12
1186 }-
1187 if (((((
((((var)->attr...000004))) == 0Description
TRUEevaluated 127 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15214 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004))) == 0
((((var)->attr...000004))) == 0Description
TRUEevaluated 127 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15214 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr...000040))) == 0Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040))) == 0
((((var)->attr...000040))) == 0Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 64 times by 1 test
Evaluated by:
  • Self test
)
63-15214
1188 return
executed 63 times by 1 test: return (ind == 0 ? ((var)->value) : (char *) ((void *)0) );
Executed by:
  • Self test
(ind == 0 ? ((var)->value) : (char *)
executed 63 times by 1 test: return (ind == 0 ? ((var)->value) : (char *) ((void *)0) );
Executed by:
  • Self test
63
1189 ((void *)0)
executed 63 times by 1 test: return (ind == 0 ? ((var)->value) : (char *) ((void *)0) );
Executed by:
  • Self test
63
1190 );
executed 63 times by 1 test: return (ind == 0 ? ((var)->value) : (char *) ((void *)0) );
Executed by:
  • Self test
63
1191 else if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15214 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15214 times by 1 test
Evaluated by:
  • Self test
)
64-15214
1192 {-
1193 retval = assoc_reference ((HASH_TABLE *)((var)->value), akey);-
1194 sh_xfree((akey), "arrayfunc.c", 1171);-
1195 }
executed 64 times by 1 test: end of block
Executed by:
  • Self test
64
1196 else-
1197 retval = array_reference ((ARRAY *)((var)->value), ind);
executed 15214 times by 1 test: retval = array_reference ((ARRAY *)((var)->value), ind);
Executed by:
  • Self test
15214
1198 }-
1199-
1200 return
executed 16072 times by 1 test: return retval;
Executed by:
  • Self test
retval;
executed 16072 times by 1 test: return retval;
Executed by:
  • Self test
16072
1201}-
1202-
1203-
1204-
1205char *-
1206array_value (s, quoted, flags, rtype, indp)-
1207 const char *s;-
1208 int quoted, flags, *rtype;-
1209 arrayind_t *indp;-
1210{-
1211 return
executed 6102 times by 1 test: return (array_value_internal (s, quoted, flags|0x001, rtype, indp));
Executed by:
  • Self test
(array_value_internal (s, quoted, flags|0x001, rtype, indp));
executed 6102 times by 1 test: return (array_value_internal (s, quoted, flags|0x001, rtype, indp));
Executed by:
  • Self test
6102
1212}-
1213-
1214-
1215-
1216-
1217-
1218char *-
1219get_array_value (s, flags, rtype, indp)-
1220 const char *s;-
1221 int flags, *rtype;-
1222 arrayind_t *indp;-
1223{-
1224 return
executed 10105 times by 1 test: return (array_value_internal (s, 0, flags, rtype, indp));
Executed by:
  • Self test
(array_value_internal (s, 0, flags, rtype, indp));
executed 10105 times by 1 test: return (array_value_internal (s, 0, flags, rtype, indp));
Executed by:
  • Self test
10105
1225}-
1226-
1227char *-
1228array_keys (s, quoted)-
1229 char *s;-
1230 int quoted;-
1231{-
1232 int len;-
1233 char *retval, *t, *temp;-
1234 WORD_LIST *l;-
1235 SHELL_VAR *var;-
1236-
1237 var = array_variable_part (s, 0, &t, &len);-
1238-
1239-
1240 if (var == 0
var == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
|| ((
(t[0]) == '@'Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
((t[0]) == '@'...) == '*') == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
(t[0]) == '@'Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
t[0]) == '@'
((t[0]) == '@'...) == '*') == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
(t[0]) == '@'Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
|| (
(t[0]) == '*'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
t[0]) == '*'
(t[0]) == '*'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
) == 0
((t[0]) == '@'...) == '*') == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
|| t[1] != ']'
t[1] != ']'Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
)
0-40
1241 return
never executed: return (char *) ((void *)0) ;
(char *)
never executed: return (char *) ((void *)0) ;
0
1242 ((void *)0)
never executed: return (char *) ((void *)0) ;
0
1243 ;
never executed: return (char *) ((void *)0) ;
0
1244-
1245 if (((
((var)->value != 0) == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
var)->value != 0) == 0
((var)->value != 0) == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
|| ((((
((((var)->attr... (0x0001000)))Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0001000)))
((((var)->attr... (0x0001000)))Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
)
0-40
1246 return
never executed: return (char *) ((void *)0) ;
(char *)
never executed: return (char *) ((void *)0) ;
0
1247 ((void *)0)
never executed: return (char *) ((void *)0) ;
0
1248 ;
never executed: return (char *) ((void *)0) ;
0
1249-
1250 if (((((
((((var)->attr...000004))) == 0Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000004))) == 0
((((var)->attr...000004))) == 0Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr...000040))) == 0Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040))) == 0
((((var)->attr...000040))) == 0Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • Self test
)
0-32
1251 l = make_word_list (make_word("0"), ((WORD_LIST *)
never executed: l = make_word_list (make_word("0"), ((WORD_LIST *) ((void *)0) ));
0
1252 ((void *)0)
never executed: l = make_word_list (make_word("0"), ((WORD_LIST *) ((void *)0) ));
0
1253 ));
never executed: l = make_word_list (make_word("0"), ((WORD_LIST *) ((void *)0) ));
0
1254 else if (((((
((((var)->attr... (0x0000040)))Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
8-32
1255 l = assoc_keys_to_word_list ((HASH_TABLE *)((var)->value));
executed 32 times by 1 test: l = assoc_keys_to_word_list ((HASH_TABLE *)((var)->value));
Executed by:
  • Self test
32
1256 else-
1257 l = array_keys_to_word_list ((ARRAY *)((var)->value));
executed 8 times by 1 test: l = array_keys_to_word_list ((ARRAY *)((var)->value));
Executed by:
  • Self test
8
1258 if (l == (WORD_LIST *)
l == (WORD_LIST *) ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
0-40
1259 ((void *)0)
l == (WORD_LIST *) ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test
0-40
1260 )-
1261 return
never executed: return ((char *) ((void *)0) );
((char *)
never executed: return ((char *) ((void *)0) );
0
1262 ((void *)0)
never executed: return ((char *) ((void *)0) );
0
1263 );
never executed: return ((char *) ((void *)0) );
0
1264-
1265 if (t[0] == '*'
t[0] == '*'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 38 times by 1 test
Evaluated by:
  • Self test
&& (
(quoted & (0x002|0x001))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
quoted & (0x002|0x001))
(quoted & (0x002|0x001))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
1-38
1266 {-
1267 temp = string_list_dollar_star (l, quoted, 0);-
1268 retval = quote_string (temp);-
1269 sh_xfree((temp), "arrayfunc.c", 1236);-
1270 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test
1
1271 else-
1272 retval = string_list_dollar_at (l, quoted, 0);
executed 39 times by 1 test: retval = string_list_dollar_at (l, quoted, 0);
Executed by:
  • Self test
39
1273-
1274 dispose_words (l);-
1275 return
executed 40 times by 1 test: return retval;
Executed by:
  • Self test
retval;
executed 40 times by 1 test: return retval;
Executed by:
  • Self test
40
1276}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2