Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | static SHELL_VAR *declare_find_variable (const char *, int, int); | - |
13 | static int declare_internal (register WORD_LIST *, int); | - |
14 | | - |
15 | | - |
16 | int | - |
17 | declare_builtin (list) | - |
18 | register WORD_LIST *list; | - |
19 | { | - |
20 | returnexecuted 1666 times by 1 test: return (declare_internal (list, 0)); (declare_internal (list, 0));executed 1666 times by 1 test: return (declare_internal (list, 0)); | 1666 |
21 | } | - |
22 | int | - |
23 | local_builtin (list) | - |
24 | register WORD_LIST *list; | - |
25 | { | - |
26 | | - |
27 | if (listTRUE | evaluated 381 times by 1 test | FALSE | evaluated 8 times by 1 test |
&& list->wordTRUE | evaluated 381 times by 1 test | FALSE | never evaluated |
&& ((TRUE | evaluated 210 times by 1 test | FALSE | evaluated 171 times by 1 test |
list->word->word)[0] == ("--help")[0]TRUE | evaluated 210 times by 1 test | FALSE | evaluated 171 times by 1 test |
&& | 0-381 |
28 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
29 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
30 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
31 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
32 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
33 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
34 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
35 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
36 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
37 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
38 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
39 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
40 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
41 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
42 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
43 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
44 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
45 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
46 | , TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
47 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
48 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
49 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
50 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
51 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
52 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
53 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
54 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
55 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
56 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
57 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
58 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
59 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
60 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
61 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
62 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
63 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
64 | , TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
65 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
66 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
67 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
68 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
69 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
70 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
71 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
72 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
73 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
74 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( list->word->word ))[3] - __s2[3]); TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
75 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( list->word->word ))[3] - __s2[3]); | 0-210 |
76 | ))[3] - __s2[3]);TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( list->word->word ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
77 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
78 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
79 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
80 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
81 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
82 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
83 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
84 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
85 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
86 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
87 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
88 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
89 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
90 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
91 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
92 | , TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
93 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
94 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
95 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
96 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
97 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
98 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
99 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
100 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
101 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
102 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "--help" ))[3] - __s2[3]); TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
103 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( "--help" ))[3] - __s2[3]); | 0-210 |
104 | ))[3] - __s2[3]);TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
never executed: __result = (((const unsigned char *) (const char *) ( "--help" ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
105 | list->word->wordTRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
106 | , TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
107 | "--help"TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
108 | )))); }) TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
| 0-210 |
109 | == 0TRUE | never evaluated | FALSE | evaluated 210 times by 1 test |
)) | 0-210 |
110 | { | - |
111 | builtin_help (); | - |
112 | return never executed: return (258); (258);never executed: return (258); | 0 |
113 | } | - |
114 | | - |
115 | if (variable_contextTRUE | evaluated 384 times by 1 test | FALSE | evaluated 5 times by 1 test |
) | 5-384 |
116 | returnexecuted 384 times by 1 test: return (declare_internal (list, 1)); (declare_internal (list, 1));executed 384 times by 1 test: return (declare_internal (list, 1)); | 384 |
117 | else | - |
118 | { | - |
119 | builtin_error ( | - |
120 | dcgettext (((void *)0), | - |
121 | "can only be used in a function" | - |
122 | , 5) | - |
123 | ); | - |
124 | returnexecuted 5 times by 1 test: return (1); (1);executed 5 times by 1 test: return (1); | 5 |
125 | } | - |
126 | } | - |
127 | | - |
128 | | - |
129 | | - |
130 | | - |
131 | | - |
132 | | - |
133 | | - |
134 | static SHELL_VAR * | - |
135 | declare_find_variable (name, mkglobal, chklocal) | - |
136 | const char *name; | - |
137 | int mkglobal, chklocal; | - |
138 | { | - |
139 | SHELL_VAR *var; | - |
140 | | - |
141 | if (mkglobal == 0TRUE | evaluated 890 times by 1 test | FALSE | evaluated 56 times by 1 test |
) | 56-890 |
142 | returnexecuted 890 times by 1 test: return (find_variable (name)); (find_variable (name));executed 890 times by 1 test: return (find_variable (name)); | 890 |
143 | else if (chklocalTRUE | evaluated 16 times by 1 test | FALSE | evaluated 40 times by 1 test |
) | 16-40 |
144 | { | - |
145 | var = find_variable (name); | - |
146 | if (varTRUE | evaluated 12 times by 1 test | FALSE | evaluated 4 times by 1 test |
&& ((((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 10 times by 1 test |
var)->attributes) & (0x0000020)))TRUE | evaluated 2 times by 1 test | FALSE | evaluated 10 times by 1 test |
&& var->context == variable_contextTRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-12 |
147 | returnexecuted 2 times by 1 test: return var; var;executed 2 times by 1 test: return var; | 2 |
148 | returnexecuted 14 times by 1 test: return (find_global_variable (name)); (find_global_variable (name));executed 14 times by 1 test: return (find_global_variable (name)); | 14 |
149 | } | - |
150 | else | - |
151 | returnexecuted 40 times by 1 test: return (find_global_variable (name)); (find_global_variable (name));executed 40 times by 1 test: return (find_global_variable (name)); | 40 |
152 | } | - |
153 | | - |
154 | | - |
155 | static int | - |
156 | declare_internal (list, local_var) | - |
157 | register WORD_LIST *list; | - |
158 | int local_var; | - |
159 | { | - |
160 | int flags_on, flags_off, *flags; | - |
161 | int any_failed, assign_error, pflag, nodefs, opt, onref, offref; | - |
162 | int mkglobal, chklocal; | - |
163 | char *t, *subscript_start; | - |
164 | SHELL_VAR *var, *refvar, *v; | - |
165 | FUNCTION_DEF *shell_fn; | - |
166 | | - |
167 | flags_on = flags_off = any_failed = assign_error = pflag = nodefs = 0; | - |
168 | mkglobal = chklocal = 0; | - |
169 | refvar = (SHELL_VAR *) | - |
170 | ((void *)0) | - |
171 | ; | - |
172 | reset_internal_getopt (); | - |
173 | while ((TRUE | evaluated 1890 times by 1 test | FALSE | evaluated 2045 times by 1 test |
opt = internal_getopt (list, "+acfgilnprtuxAFG")) != -1TRUE | evaluated 1890 times by 1 test | FALSE | evaluated 2045 times by 1 test |
) | 1890-2045 |
174 | { | - |
175 | flags = list_opttype == '+'TRUE | evaluated 52 times by 1 test | FALSE | evaluated 1838 times by 1 test |
? &flags_off : &flags_on; | 52-1838 |
176 | | - |
177 | | - |
178 | | - |
179 | switch (opt) | - |
180 | { | - |
181 | caseexecuted 298 times by 1 test: case 'a': 'a':executed 298 times by 1 test: case 'a': | 298 |
182 | | - |
183 | *flags |= 0x0000004; | - |
184 | break;executed 298 times by 1 test: break; | 298 |
185 | | - |
186 | | - |
187 | | - |
188 | | - |
189 | caseexecuted 135 times by 1 test: case 'A': 'A':executed 135 times by 1 test: case 'A': | 135 |
190 | | - |
191 | *flags |= 0x0000040; | - |
192 | break;executed 135 times by 1 test: break; | 135 |
193 | | - |
194 | | - |
195 | | - |
196 | | - |
197 | caseexecuted 433 times by 1 test: case 'p': 'p':executed 433 times by 1 test: case 'p': | 433 |
198 | if (local_var == 0TRUE | evaluated 433 times by 1 test | FALSE | never evaluated |
) | 0-433 |
199 | pflag++;executed 433 times by 1 test: pflag++; | 433 |
200 | break;executed 433 times by 1 test: break; | 433 |
201 | caseexecuted 14 times by 1 test: case 'F': 'F':executed 14 times by 1 test: case 'F': | 14 |
202 | nodefs++; | - |
203 | *flags |= 0x0000008; | - |
204 | break;executed 14 times by 1 test: break; | 14 |
205 | caseexecuted 46 times by 1 test: case 'f': 'f':executed 46 times by 1 test: case 'f': | 46 |
206 | *flags |= 0x0000008; | - |
207 | break;executed 46 times by 1 test: break; | 46 |
208 | caseexecuted 16 times by 1 test: case 'G': 'G':executed 16 times by 1 test: case 'G': | 16 |
209 | if (flags == &flags_onTRUE | evaluated 16 times by 1 test | FALSE | never evaluated |
) | 0-16 |
210 | chklocal = 1;executed 16 times by 1 test: chklocal = 1; | 16 |
211 | | - |
212 | caseexecuted 56 times by 1 test: case 'g': 'g':executed 56 times by 1 test: case 'g': code before this statement executed 16 times by 1 test: case 'g': | 16-56 |
213 | if (flags == &flags_onTRUE | evaluated 72 times by 1 test | FALSE | never evaluated |
) | 0-72 |
214 | mkglobal = 1;executed 72 times by 1 test: mkglobal = 1; | 72 |
215 | break;executed 72 times by 1 test: break; | 72 |
216 | caseexecuted 371 times by 1 test: case 'i': 'i':executed 371 times by 1 test: case 'i': | 371 |
217 | *flags |= 0x0000010; | - |
218 | break;executed 371 times by 1 test: break; | 371 |
219 | caseexecuted 375 times by 1 test: case 'n': 'n':executed 375 times by 1 test: case 'n': | 375 |
220 | *flags |= 0x0000800; | - |
221 | break;executed 375 times by 1 test: break; | 375 |
222 | caseexecuted 94 times by 1 test: case 'r': 'r':executed 94 times by 1 test: case 'r': | 94 |
223 | *flags |= 0x0000002; | - |
224 | break;executed 94 times by 1 test: break; | 94 |
225 | caseexecuted 8 times by 1 test: case 't': 't':executed 8 times by 1 test: case 't': | 8 |
226 | *flags |= 0x0000080; | - |
227 | break;executed 8 times by 1 test: break; | 8 |
228 | caseexecuted 26 times by 1 test: case 'x': 'x':executed 26 times by 1 test: case 'x': | 26 |
229 | *flags |= 0x0000001; | - |
230 | array_needs_making = 1; | - |
231 | break;executed 26 times by 1 test: break; | 26 |
232 | | - |
233 | | - |
234 | caseexecuted 1 time by 1 test: case 'c': 'c':executed 1 time by 1 test: case 'c': | 1 |
235 | *flags |= 0x0000400; | - |
236 | if (flags == &flags_onTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-1 |
237 | flags_off |= 0x0000100|0x0000200;executed 1 time by 1 test: flags_off |= 0x0000100|0x0000200; | 1 |
238 | break;executed 1 time by 1 test: break; | 1 |
239 | | - |
240 | caseexecuted 10 times by 1 test: case 'l': 'l':executed 10 times by 1 test: case 'l': | 10 |
241 | *flags |= 0x0000200; | - |
242 | if (flags == &flags_onTRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
) | 0-10 |
243 | flags_off |= 0x0000400|0x0000100;executed 10 times by 1 test: flags_off |= 0x0000400|0x0000100; | 10 |
244 | break;executed 10 times by 1 test: break; | 10 |
245 | caseexecuted 2 times by 1 test: case 'u': 'u':executed 2 times by 1 test: case 'u': | 2 |
246 | *flags |= 0x0000100; | - |
247 | if (flags == &flags_onTRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-2 |
248 | flags_off |= 0x0000400|0x0000200;executed 2 times by 1 test: flags_off |= 0x0000400|0x0000200; | 2 |
249 | break;executed 2 times by 1 test: break; | 2 |
250 | | - |
251 | case never executed: case -99: -99:never executed: case -99: builtin_help (); returnnever executed: return (258); (258);never executed: return (258); | 0 |
252 | defaultexecuted 5 times by 1 test: default: :executed 5 times by 1 test: default: | 5 |
253 | builtin_usage (); | - |
254 | returnexecuted 5 times by 1 test: return (258); (258);executed 5 times by 1 test: return (258); | 5 |
255 | } | - |
256 | } | - |
257 | | - |
258 | list = loptend; | - |
259 | | - |
260 | | - |
261 | | - |
262 | if (list == 0TRUE | evaluated 32 times by 1 test | FALSE | evaluated 2013 times by 1 test |
) | 32-2013 |
263 | { | - |
264 | | - |
265 | | - |
266 | if (local_varTRUE | evaluated 3 times by 1 test | FALSE | evaluated 29 times by 1 test |
) | 3-29 |
267 | { | - |
268 | register SHELL_VAR **vlist; | - |
269 | register int i; | - |
270 | | - |
271 | vlist = all_local_variables (); | - |
272 | | - |
273 | if (vlistTRUE | evaluated 3 times by 1 test | FALSE | never evaluated |
) | 0-3 |
274 | { | - |
275 | for (i = 0; vlist[i]TRUE | evaluated 6 times by 1 test | FALSE | evaluated 3 times by 1 test |
; i++) | 3-6 |
276 | print_assignment (vlist[i]);executed 6 times by 1 test: print_assignment (vlist[i]); | 6 |
277 | | - |
278 | sh_xfree((vlist), "./declare.def", 285); | - |
279 | }executed 3 times by 1 test: end of block | 3 |
280 | }executed 3 times by 1 test: end of block | 3 |
281 | else if (pflagTRUE | evaluated 1 time by 1 test | FALSE | evaluated 28 times by 1 test |
&& (flags_on == 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
|| flags_on == 0x0000008TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
)) | 0-28 |
282 | show_all_var_attributes (flags_on == 0, nodefs); never executed: show_all_var_attributes (flags_on == 0, nodefs); | 0 |
283 | else if (flags_on == 0TRUE | never evaluated | FALSE | evaluated 29 times by 1 test |
) | 0-29 |
284 | return never executed: return (set_builtin ((WORD_LIST *) ((void *)0) )); (set_builtin ((WORD_LIST *)never executed: return (set_builtin ((WORD_LIST *) ((void *)0) )); | 0 |
285 | ((void *)0) never executed: return (set_builtin ((WORD_LIST *) ((void *)0) )); | 0 |
286 | )); never executed: return (set_builtin ((WORD_LIST *) ((void *)0) )); | 0 |
287 | else | - |
288 | set_or_show_attributes ((WORD_LIST *)executed 29 times by 1 test: set_or_show_attributes ((WORD_LIST *) ((void *)0) , flags_on, nodefs); | 29 |
289 | ((void *)0)executed 29 times by 1 test: set_or_show_attributes ((WORD_LIST *) ((void *)0) , flags_on, nodefs); | 29 |
290 | , flags_on, nodefs);executed 29 times by 1 test: set_or_show_attributes ((WORD_LIST *) ((void *)0) , flags_on, nodefs); | 29 |
291 | | - |
292 | returnexecuted 32 times by 1 test: return (sh_chkwrite (0)); (sh_chkwrite (0));executed 32 times by 1 test: return (sh_chkwrite (0)); | 32 |
293 | } | - |
294 | | - |
295 | if (pflagTRUE | evaluated 432 times by 1 test | FALSE | evaluated 1581 times by 1 test |
) | 432-1581 |
296 | { | - |
297 | for (any_failed = 0; listTRUE | evaluated 520 times by 1 test | FALSE | evaluated 432 times by 1 test |
; list = list->next) | 432-520 |
298 | { | - |
299 | if (flags_on & 0x0000008TRUE | evaluated 8 times by 1 test | FALSE | evaluated 512 times by 1 test |
) | 8-512 |
300 | pflag = show_func_attributes (list->word->word, nodefs);executed 8 times by 1 test: pflag = show_func_attributes (list->word->word, nodefs); | 8 |
301 | else | - |
302 | pflag = show_name_attributes (list->word->word, nodefs);executed 512 times by 1 test: pflag = show_name_attributes (list->word->word, nodefs); | 512 |
303 | if (pflagTRUE | evaluated 53 times by 1 test | FALSE | evaluated 467 times by 1 test |
) | 53-467 |
304 | { | - |
305 | sh_notfound (list->word->word); | - |
306 | any_failed++; | - |
307 | }executed 53 times by 1 test: end of block | 53 |
308 | }executed 520 times by 1 test: end of block | 520 |
309 | returnexecuted 432 times by 1 test: return (sh_chkwrite (any_failed ? 1 : 0)); (sh_chkwrite (any_failed ? 1 : 0));executed 432 times by 1 test: return (sh_chkwrite (any_failed ? 1 : 0)); | 432 |
310 | } | - |
311 | | - |
312 | | - |
313 | | - |
314 | | - |
315 | while (listTRUE | evaluated 1803 times by 1 test | FALSE | evaluated 1572 times by 1 test |
) | 1572-1803 |
316 | { | - |
317 | char *value, *name, *oldname; | - |
318 | int offset, aflags, wflags, created_var, namelen; | - |
319 | int assoc_noexpand; | - |
320 | | - |
321 | int making_array_special, compound_array_assign, simple_array_assign; | - |
322 | int var_exists, array_exists, creating_array, array_subscript_assignment; | - |
323 | | - |
324 | | - |
325 | name = (char *)strcpy (sh_xmalloc((1 + strlen (list->word->word)), "./declare.def", 328), (list->word->word)); | - |
326 | wflags = list->word->flags; | - |
327 | | - |
328 | assoc_noexpand = assoc_expand_onceTRUE | evaluated 7 times by 1 test | FALSE | evaluated 1796 times by 1 test |
&& (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 6 times by 1 test |
wflags & 0x000004)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 6 times by 1 test |
; | 1-1796 |
329 | | - |
330 | | - |
331 | | - |
332 | offset = assignment (name, assoc_noexpand ? 2 : 0); | - |
333 | aflags = 0; | - |
334 | created_var = 0; | - |
335 | | - |
336 | if (local_varTRUE | evaluated 520 times by 1 test | FALSE | evaluated 1283 times by 1 test |
&& variable_contextTRUE | evaluated 520 times by 1 test | FALSE | never evaluated |
&& ((TRUE | never evaluated | FALSE | evaluated 520 times by 1 test |
name)[0] == ("-")[0]TRUE | never evaluated | FALSE | evaluated 520 times by 1 test |
&& | 0-1283 |
337 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
338 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
339 | ) && __builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
340 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
341 | ) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
342 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
343 | ), __s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
344 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
345 | ), (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
346 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
347 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
348 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
349 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
350 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
351 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
352 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
353 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
354 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
355 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
356 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
357 | ) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
358 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
359 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
360 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
361 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
362 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
363 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
364 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
365 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
366 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
367 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
368 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
369 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
370 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
371 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
372 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
373 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
374 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
375 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
376 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
377 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
378 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
379 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
380 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
381 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
382 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
383 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]); | 0 |
384 | nameTRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]); | 0 |
385 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
386 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
387 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
388 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
389 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
390 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
391 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
392 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
393 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
394 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
395 | ) && ((size_t)(const void *)((TRUE | never evaluated | FALSE | never evaluated |
| 0 |
396 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
397 | ) + 1) - (size_t)(const void *)(TRUE | never evaluated | FALSE | never evaluated |
| 0 |
398 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
399 | ) == 1) ? __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
400 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
401 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
402 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
403 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
404 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
405 | ); int __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
406 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
407 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
408 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
409 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
410 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
411 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0 |
412 | "-"TRUE | never evaluated | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0 |
413 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
414 | nameTRUE | never evaluated | FALSE | never evaluated |
| 0 |
415 | , TRUE | never evaluated | FALSE | never evaluated |
| 0 |
416 | "-"TRUE | never evaluated | FALSE | never evaluated |
| 0 |
417 | )))); }) TRUE | never evaluated | FALSE | never evaluated |
| 0 |
418 | == 0TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
419 | { | - |
420 | var = make_local_variable ("-", 0); | - |
421 | do { if (((TRUE | never evaluated | FALSE | never evaluated |
var)->value)TRUE | never evaluated | FALSE | never evaluated |
) sh_xfree((((var)->value)), "./declare.def", 342);never executed: sh_xfree((((var)->value)), "./declare.def", 342); } while (0); | 0 |
422 | value = get_current_options (); | - |
423 | ((var)->value = (value)); | - |
424 | ((var)->attributes |= (0x0001000)); | - |
425 | sh_xfree((name), "./declare.def", 346); list = list->next; continue; never executed: continue; | 0 |
426 | } | - |
427 | | - |
428 | if (offsetTRUE | evaluated 824 times by 1 test | FALSE | evaluated 979 times by 1 test |
) | 824-979 |
429 | { | - |
430 | name[offset] = '\0'; | - |
431 | value = name + offset + 1; | - |
432 | if (name[offset - 1] == '+'TRUE | evaluated 5 times by 1 test | FALSE | evaluated 819 times by 1 test |
) | 5-819 |
433 | { | - |
434 | aflags |= 0x0001; | - |
435 | name[offset - 1] = '\0'; | - |
436 | }executed 5 times by 1 test: end of block | 5 |
437 | }executed 824 times by 1 test: end of block | 824 |
438 | else | - |
439 | value = "";executed 979 times by 1 test: value = ""; | 979 |
440 | | - |
441 | | - |
442 | | - |
443 | if (flags_on & 0x0000800TRUE | evaluated 362 times by 1 test | FALSE | evaluated 1441 times by 1 test |
) | 362-1441 |
444 | { | - |
445 | | - |
446 | if (valid_array_reference (name, 0)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 361 times by 1 test |
) | 1-361 |
447 | { | - |
448 | builtin_error ( | - |
449 | dcgettext (((void *)0), | - |
450 | "%s: reference variable cannot be an array" | - |
451 | , 5) | - |
452 | , name); | - |
453 | assign_error++; | - |
454 | sh_xfree((name), "./declare.def", 371); list = list->next; continue;executed 1 time by 1 test: continue; | 1 |
455 | } | - |
456 | else | - |
457 | | - |
458 | | - |
459 | if (check_selfref (name, value, 0)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 350 times by 1 test |
) | 11-350 |
460 | { | - |
461 | if (variable_context == 0TRUE | evaluated 3 times by 1 test | FALSE | evaluated 8 times by 1 test |
) | 3-8 |
462 | { | - |
463 | builtin_error ( | - |
464 | dcgettext (((void *)0), | - |
465 | "%s: nameref variable self references not allowed" | - |
466 | , 5) | - |
467 | , name); | - |
468 | assign_error++; | - |
469 | sh_xfree((name), "./declare.def", 382); list = list->next; continue;executed 3 times by 1 test: continue; | 3 |
470 | } | - |
471 | else | - |
472 | builtin_warning (executed 8 times by 1 test: builtin_warning ( dcgettext (((void *)0), "%s: circular name reference" , 5) , name); | 8 |
473 | dcgettext (((void *)0), executed 8 times by 1 test: builtin_warning ( dcgettext (((void *)0), "%s: circular name reference" , 5) , name); | 8 |
474 | "%s: circular name reference"executed 8 times by 1 test: builtin_warning ( dcgettext (((void *)0), "%s: circular name reference" , 5) , name); | 8 |
475 | , 5)executed 8 times by 1 test: builtin_warning ( dcgettext (((void *)0), "%s: circular name reference" , 5) , name); | 8 |
476 | , name);executed 8 times by 1 test: builtin_warning ( dcgettext (((void *)0), "%s: circular name reference" , 5) , name); | 8 |
477 | } | - |
478 | | - |
479 | if (valueTRUE | evaluated 358 times by 1 test | FALSE | never evaluated |
&& *TRUE | evaluated 170 times by 1 test | FALSE | evaluated 188 times by 1 test |
valueTRUE | evaluated 170 times by 1 test | FALSE | evaluated 188 times by 1 test |
&& (TRUE | evaluated 168 times by 1 test | FALSE | evaluated 2 times by 1 test |
aflags & 0x0001) == 0TRUE | evaluated 168 times by 1 test | FALSE | evaluated 2 times by 1 test |
&& valid_nameref_value (value, 1) == 0TRUE | evaluated 8 times by 1 test | FALSE | evaluated 160 times by 1 test |
) | 0-358 |
480 | { | - |
481 | builtin_error ( | - |
482 | dcgettext (((void *)0), | - |
483 | "`%s': invalid variable name for name reference" | - |
484 | , 5) | - |
485 | , value); | - |
486 | assign_error++; | - |
487 | sh_xfree((name), "./declare.def", 392); list = list->next; continue;executed 8 times by 1 test: continue; | 8 |
488 | } | - |
489 | | - |
490 | }executed 350 times by 1 test: end of block | 350 |
491 | | - |
492 | restart_new_var_name:code before this statement executed 1791 times by 1 test: restart_new_var_name: | 1791 |
493 | | - |
494 | var_exists = array_exists = creating_array = 0; | - |
495 | compound_array_assign = simple_array_assign = 0; | - |
496 | array_subscript_assignment = 0; | - |
497 | subscript_start = (char *) | - |
498 | ((void *)0) | - |
499 | ; | - |
500 | if ((TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
t = TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
501 | (__extension__ (__builtin_constant_p (TRUE | evaluated 1804 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
502 | '['TRUE | evaluated 1804 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
503 | )TRUE | evaluated 1804 times by 1 test | FALSE | never evaluated |
&& !__builtin_constant_p (TRUE | evaluated 1804 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
504 | nameTRUE | evaluated 1804 times by 1 test | FALSE | never evaluated |
TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
505 | )TRUE | evaluated 1804 times by 1 test | FALSE | never evaluated |
&& (TRUE | never evaluated | FALSE | evaluated 1804 times by 1 test |
TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
506 | '['TRUE | never evaluated | FALSE | evaluated 1804 times by 1 test |
TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
507 | ) == '\0'TRUE | never evaluated | FALSE | evaluated 1804 times by 1 test |
? (char *) __rawmemchr (TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 0-1804 |
508 | nameTRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
509 | , TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
510 | '['TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
511 | ) : __builtin_strchr (TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
512 | nameTRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
513 | , TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
514 | '['TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
515 | )))TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
| 96-1708 |
516 | )TRUE | evaluated 96 times by 1 test | FALSE | evaluated 1708 times by 1 test |
&& (TRUE | evaluated 96 times by 1 test | FALSE | never evaluated |
flags_on & 0x0000008) == 0TRUE | evaluated 96 times by 1 test | FALSE | never evaluated |
) | 0-1708 |
517 | { | - |
518 | | - |
519 | | - |
520 | if (offset == 0TRUE | evaluated 39 times by 1 test | FALSE | evaluated 57 times by 1 test |
&& valid_array_reference (name, 0) == 0TRUE | evaluated 4 times by 1 test | FALSE | evaluated 35 times by 1 test |
) | 4-57 |
521 | { | - |
522 | sh_invalidid (name); | - |
523 | assign_error++; | - |
524 | sh_xfree((name), "./declare.def", 411); list = list->next; continue;executed 4 times by 1 test: continue; | 4 |
525 | } | - |
526 | subscript_start = t; | - |
527 | *t = '\0'; | - |
528 | making_array_special = 1; | - |
529 | array_subscript_assignment = offset != 0; | - |
530 | }executed 92 times by 1 test: end of block | 92 |
531 | else | - |
532 | making_array_special = 0;executed 1708 times by 1 test: making_array_special = 0; | 1708 |
533 | | - |
534 | | - |
535 | | - |
536 | | - |
537 | | - |
538 | | - |
539 | if ((posixly_correctTRUE | evaluated 2 times by 1 test | FALSE | evaluated 1798 times by 1 test |
|| (TRUE | evaluated 1756 times by 1 test | FALSE | evaluated 42 times by 1 test |
flags_on & 0x0000008) == 0TRUE | evaluated 1756 times by 1 test | FALSE | evaluated 42 times by 1 test |
) && legal_identifier (name) == 0TRUE | evaluated 10 times by 1 test | FALSE | evaluated 1748 times by 1 test |
) | 2-1798 |
540 | { | - |
541 | sh_invalidid (name); | - |
542 | assign_error++; | - |
543 | sh_xfree((name), "./declare.def", 430); list = list->next; continue;executed 10 times by 1 test: continue; | 10 |
544 | } | - |
545 | refvar = (SHELL_VAR *) | - |
546 | ((void *)0) | - |
547 | ; | - |
548 | if (variable_contextTRUE | evaluated 749 times by 1 test | FALSE | evaluated 1041 times by 1 test |
&& mkglobal == 0TRUE | evaluated 703 times by 1 test | FALSE | evaluated 46 times by 1 test |
&& ((TRUE | evaluated 703 times by 1 test | FALSE | never evaluated |
flags_on & 0x0000008) == 0)TRUE | evaluated 703 times by 1 test | FALSE | never evaluated |
) | 0-1041 |
549 | { | - |
550 | | - |
551 | | - |
552 | if (flags_on & 0x0000040TRUE | evaluated 3 times by 1 test | FALSE | evaluated 700 times by 1 test |
) | 3-700 |
553 | var = make_local_assoc_variable (name);executed 3 times by 1 test: var = make_local_assoc_variable (name); | 3 |
554 | else if ((TRUE | evaluated 23 times by 1 test | FALSE | evaluated 677 times by 1 test |
flags_on & 0x0000004)TRUE | evaluated 23 times by 1 test | FALSE | evaluated 677 times by 1 test |
|| making_array_specialTRUE | evaluated 1 time by 1 test | FALSE | evaluated 676 times by 1 test |
) | 1-677 |
555 | var = make_local_array_variable (name, making_array_special);executed 24 times by 1 test: var = make_local_array_variable (name, making_array_special); | 24 |
556 | else | - |
557 | | - |
558 | if (offset == 0TRUE | evaluated 259 times by 1 test | FALSE | evaluated 417 times by 1 test |
&& (TRUE | evaluated 21 times by 1 test | FALSE | evaluated 238 times by 1 test |
flags_on & 0x0000800)TRUE | evaluated 21 times by 1 test | FALSE | evaluated 238 times by 1 test |
) | 21-417 |
559 | { | - |
560 | | - |
561 | refvar = find_variable_last_nameref (name, 1); | - |
562 | var = find_variable (name); | - |
563 | | - |
564 | | - |
565 | | - |
566 | | - |
567 | if (refvarTRUE | evaluated 16 times by 1 test | FALSE | evaluated 5 times by 1 test |
&& refvar->context != variable_contextTRUE | evaluated 3 times by 1 test | FALSE | evaluated 13 times by 1 test |
) | 3-16 |
568 | { | - |
569 | refvar = 0; | - |
570 | var = make_local_variable (name, 0); | - |
571 | }executed 3 times by 1 test: end of block | 3 |
572 | else if (refvarTRUE | evaluated 13 times by 1 test | FALSE | evaluated 5 times by 1 test |
&& refvar->context == variable_contextTRUE | evaluated 13 times by 1 test | FALSE | never evaluated |
) | 0-13 |
573 | var = refvar;executed 13 times by 1 test: var = refvar; | 13 |
574 | | - |
575 | else if (var == 0TRUE | evaluated 5 times by 1 test | FALSE | never evaluated |
|| var->context != variable_contextTRUE | never evaluated | FALSE | never evaluated |
) | 0-5 |
576 | var = make_local_variable (name, 0);executed 5 times by 1 test: var = make_local_variable (name, 0); | 5 |
577 | | - |
578 | }executed 21 times by 1 test: end of block | 21 |
579 | else | - |
580 | | - |
581 | var = make_local_variable (name, 0);executed 655 times by 1 test: var = make_local_variable (name, 0); | 655 |
582 | if (var == 0TRUE | evaluated 2 times by 1 test | FALSE | evaluated 701 times by 1 test |
) | 2-701 |
583 | { | - |
584 | any_failed++; | - |
585 | sh_xfree((name), "./declare.def", 478); list = list->next; continue;executed 2 times by 1 test: continue; | 2 |
586 | } | - |
587 | if (varTRUE | evaluated 701 times by 1 test | FALSE | never evaluated |
&& ((((TRUE | evaluated 10 times by 1 test | FALSE | evaluated 691 times by 1 test |
var)->attributes) & (0x0000800)))TRUE | evaluated 10 times by 1 test | FALSE | evaluated 691 times by 1 test |
&& ((((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 8 times by 1 test |
var)->attributes) & (0x0000002)))TRUE | evaluated 2 times by 1 test | FALSE | evaluated 8 times by 1 test |
&& ((TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
var)->value)TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
&& (TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
flags_off & 0x0000800)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-701 |
588 | { | - |
589 | sh_readonly (name); | - |
590 | any_failed++; | - |
591 | sh_xfree((name), "./declare.def", 484); list = list->next; continue;executed 1 time by 1 test: continue; | 1 |
592 | } | - |
593 | }executed 700 times by 1 test: end of block | 700 |
594 | else | - |
595 | var = (SHELL_VAR *)executed 1087 times by 1 test: var = (SHELL_VAR *) ((void *)0) ; | 1087 |
596 | ((void *)0)executed 1087 times by 1 test: var = (SHELL_VAR *) ((void *)0) ; | 1087 |
597 | ;executed 1087 times by 1 test: var = (SHELL_VAR *) ((void *)0) ; | 1087 |
598 | | - |
599 | | - |
600 | | - |
601 | | - |
602 | | - |
603 | | - |
604 | | - |
605 | if (flags_on & 0x0000008TRUE | evaluated 42 times by 1 test | FALSE | evaluated 1745 times by 1 test |
) | 42-1745 |
606 | { | - |
607 | if (offsetTRUE | evaluated 5 times by 1 test | FALSE | evaluated 37 times by 1 test |
) | 5-37 |
608 | { | - |
609 | builtin_error ( | - |
610 | dcgettext (((void *)0), | - |
611 | "cannot use `-f' to make functions" | - |
612 | , 5) | - |
613 | ); | - |
614 | sh_xfree((name), "./declare.def", 501); | - |
615 | returnexecuted 5 times by 1 test: return (1); (1);executed 5 times by 1 test: return (1); | 5 |
616 | } | - |
617 | else | - |
618 | { | - |
619 | var = find_function (name); | - |
620 | | - |
621 | if (varTRUE | evaluated 35 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 2-35 |
622 | { | - |
623 | if (((((TRUE | evaluated 10 times by 1 test | FALSE | evaluated 25 times by 1 test |
var)->attributes) & (0x0000002)))TRUE | evaluated 10 times by 1 test | FALSE | evaluated 25 times by 1 test |
&& (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 5 times by 1 test |
flags_off & 0x0000002)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 5 times by 1 test |
) | 5-25 |
624 | { | - |
625 | builtin_error ( | - |
626 | dcgettext (((void *)0), | - |
627 | "%s: readonly function" | - |
628 | , 5) | - |
629 | , name); | - |
630 | any_failed++; | - |
631 | sh_xfree((name), "./declare.def", 514); list = list->next; continue;executed 5 times by 1 test: continue; | 5 |
632 | } | - |
633 | | - |
634 | | - |
635 | if (flags_on == 0x0000008TRUE | evaluated 19 times by 1 test | FALSE | evaluated 11 times by 1 test |
&& flags_off == 0TRUE | evaluated 19 times by 1 test | FALSE | never evaluated |
) | 0-19 |
636 | { | - |
637 | | - |
638 | if (nodefsTRUE | evaluated 5 times by 1 test | FALSE | evaluated 14 times by 1 test |
&& debugging_modeTRUE | never evaluated | FALSE | evaluated 5 times by 1 test |
) | 0-14 |
639 | { | - |
640 | shell_fn = find_function_def (var->name); | - |
641 | if (shell_fnTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
642 | printf ("%s %d %s\n", var->name, shell_fn->line, shell_fn->source_file); never executed: printf ("%s %d %s\n", var->name, shell_fn->line, shell_fn->source_file); | 0 |
643 | else | - |
644 | printf ("%s\n", var->name); never executed: printf ("%s\n", var->name); | 0 |
645 | } | - |
646 | else | - |
647 | | - |
648 | { | - |
649 | t = nodefsTRUE | evaluated 5 times by 1 test | FALSE | evaluated 14 times by 1 test |
? var->name | 5-14 |
650 | : named_function_string (name, (COMMAND *)((var)->value), 0x01|0x02); | - |
651 | printf ("%s\n", t); | - |
652 | any_failed = sh_chkwrite (any_failed); | - |
653 | }executed 19 times by 1 test: end of block | 19 |
654 | } | - |
655 | else | - |
656 | { | - |
657 | ((var)->attributes |= (flags_on)); | - |
658 | ((var)->attributes &= ~(flags_off)); | - |
659 | }executed 11 times by 1 test: end of block | 11 |
660 | } | - |
661 | else | - |
662 | any_failed++;executed 2 times by 1 test: any_failed++; | 2 |
663 | sh_xfree((name), "./declare.def", 546); list = list->next; continue;executed 32 times by 1 test: continue; | 32 |
664 | } | - |
665 | } | - |
666 | else | - |
667 | { | - |
668 | if (var == 0TRUE | evaluated 1045 times by 1 test | FALSE | evaluated 700 times by 1 test |
&& (TRUE | evaluated 267 times by 1 test | FALSE | evaluated 778 times by 1 test |
flags_on & 0x0000800)TRUE | evaluated 267 times by 1 test | FALSE | evaluated 778 times by 1 test |
) | 267-1045 |
669 | { | - |
670 | | - |
671 | | - |
672 | var = mkglobalTRUE | never evaluated | FALSE | evaluated 267 times by 1 test |
? find_global_variable_noref (name) : find_variable_noref (name); | 0-267 |
673 | if (varTRUE | evaluated 96 times by 1 test | FALSE | evaluated 171 times by 1 test |
&& ((((TRUE | evaluated 61 times by 1 test | FALSE | evaluated 35 times by 1 test |
var)->attributes) & (0x0000800))) == 0TRUE | evaluated 61 times by 1 test | FALSE | evaluated 35 times by 1 test |
) | 35-171 |
674 | var = 0;executed 61 times by 1 test: var = 0; | 61 |
675 | }executed 267 times by 1 test: end of block | 267 |
676 | | - |
677 | | - |
678 | | - |
679 | | - |
680 | | - |
681 | | - |
682 | else if (var == 0TRUE | evaluated 778 times by 1 test | FALSE | evaluated 700 times by 1 test |
&& (TRUE | evaluated 15 times by 1 test | FALSE | evaluated 763 times by 1 test |
flags_off & 0x0000800)TRUE | evaluated 15 times by 1 test | FALSE | evaluated 763 times by 1 test |
) | 15-778 |
683 | { | - |
684 | | - |
685 | refvar = mkglobalTRUE | never evaluated | FALSE | evaluated 15 times by 1 test |
? find_global_variable_last_nameref (name, 0) : find_variable_last_nameref (name, 0); | 0-15 |
686 | if (refvarTRUE | evaluated 11 times by 1 test | FALSE | evaluated 4 times by 1 test |
&& ((((TRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
refvar)->attributes) & (0x0000800))) == 0TRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
) | 0-11 |
687 | refvar = 0; never executed: refvar = 0; | 0 |
688 | | - |
689 | | - |
690 | | - |
691 | | - |
692 | if (refvarTRUE | evaluated 11 times by 1 test | FALSE | evaluated 4 times by 1 test |
&& ((TRUE | evaluated 11 times by 1 test | FALSE | never evaluated |
refvar)->value)TRUE | evaluated 11 times by 1 test | FALSE | never evaluated |
&& ((((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 9 times by 1 test |
refvar)->attributes) & (0x0000002)))TRUE | evaluated 2 times by 1 test | FALSE | evaluated 9 times by 1 test |
) | 0-11 |
693 | { | - |
694 | sh_readonly (name); | - |
695 | any_failed++; | - |
696 | sh_xfree((name), "./declare.def", 594); list = list->next; continue;executed 2 times by 1 test: continue; | 2 |
697 | } | - |
698 | | - |
699 | | - |
700 | | - |
701 | | - |
702 | if (refvarTRUE | evaluated 9 times by 1 test | FALSE | evaluated 4 times by 1 test |
&& flags_on == 0TRUE | evaluated 8 times by 1 test | FALSE | evaluated 1 time by 1 test |
&& offset == 0TRUE | evaluated 7 times by 1 test | FALSE | evaluated 1 time by 1 test |
&& (TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
flags_off & ~0x0000800) == 0TRUE | evaluated 7 times by 1 test | FALSE | never evaluated |
) | 0-9 |
703 | { | - |
704 | ((refvar)->attributes &= ~(0x0000800)); | - |
705 | sh_xfree((name), "./declare.def", 603); list = list->next; continue;executed 7 times by 1 test: continue; | 7 |
706 | } | - |
707 | | - |
708 | if (refvarTRUE | evaluated 2 times by 1 test | FALSE | evaluated 4 times by 1 test |
) | 2-4 |
709 | | - |
710 | var = mkglobalTRUE | never evaluated | FALSE | evaluated 2 times by 1 test |
? find_global_variable (((refvar)->value)) : find_variable (((refvar)->value));executed 2 times by 1 test: var = mkglobal ? find_global_variable (((refvar)->value)) : find_variable (((refvar)->value)); | 0-2 |
711 | }executed 6 times by 1 test: end of block | 6 |
712 | | - |
713 | | - |
714 | | - |
715 | else if (var == 0TRUE | evaluated 763 times by 1 test | FALSE | evaluated 700 times by 1 test |
&& offsetTRUE | evaluated 287 times by 1 test | FALSE | evaluated 476 times by 1 test |
&& array_subscript_assignmentTRUE | evaluated 56 times by 1 test | FALSE | evaluated 231 times by 1 test |
) | 56-763 |
716 | { | - |
717 | var = mkglobalTRUE | never evaluated | FALSE | evaluated 56 times by 1 test |
? find_global_variable_noref (name) : find_variable_noref (name); | 0-56 |
718 | if (varTRUE | evaluated 38 times by 1 test | FALSE | evaluated 18 times by 1 test |
&& ((((TRUE | evaluated 1 time by 1 test | FALSE | evaluated 37 times by 1 test |
var)->attributes) & (0x0000800)))TRUE | evaluated 1 time by 1 test | FALSE | evaluated 37 times by 1 test |
) | 1-38 |
719 | { | - |
720 | internal_warning ( | - |
721 | dcgettext (((void *)0), | - |
722 | "%s: removing nameref attribute" | - |
723 | , 5) | - |
724 | , name); | - |
725 | do { if (((TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
var)->value)TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) sh_xfree((((var)->value)), "./declare.def", 619);executed 1 time by 1 test: sh_xfree((((var)->value)), "./declare.def", 619); } while (0); | 0-1 |
726 | ((var)->value = ((char *) | - |
727 | ((void *)0) | - |
728 | )); | - |
729 | ((var)->attributes &= ~(0x0000800)); | - |
730 | }executed 1 time by 1 test: end of block | 1 |
731 | }executed 56 times by 1 test: end of block | 56 |
732 | if (var == 0TRUE | evaluated 962 times by 1 test | FALSE | evaluated 774 times by 1 test |
&& (flags_onTRUE | evaluated 843 times by 1 test | FALSE | evaluated 119 times by 1 test |
|| flags_offTRUE | evaluated 35 times by 1 test | FALSE | evaluated 84 times by 1 test |
|| offsetTRUE | evaluated 71 times by 1 test | FALSE | evaluated 13 times by 1 test |
)) | 13-962 |
733 | { | - |
734 | refvar = mkglobalTRUE | evaluated 46 times by 1 test | FALSE | evaluated 903 times by 1 test |
? find_global_variable_last_nameref (name, 0) : find_variable_last_nameref (name, 0); | 46-903 |
735 | if (refvarTRUE | evaluated 328 times by 1 test | FALSE | evaluated 621 times by 1 test |
&& ((((TRUE | evaluated 312 times by 1 test | FALSE | evaluated 16 times by 1 test |
refvar)->attributes) & (0x0000800))) == 0TRUE | evaluated 312 times by 1 test | FALSE | evaluated 16 times by 1 test |
) | 16-621 |
736 | refvar = 0;executed 312 times by 1 test: refvar = 0; | 312 |
737 | if (refvarTRUE | evaluated 16 times by 1 test | FALSE | evaluated 933 times by 1 test |
) | 16-933 |
738 | | - |
739 | var = mkglobalTRUE | never evaluated | FALSE | evaluated 16 times by 1 test |
? find_global_variable (((refvar)->value)) : find_variable (((refvar)->value));executed 16 times by 1 test: var = mkglobal ? find_global_variable (((refvar)->value)) : find_variable (((refvar)->value)); | 0-16 |
740 | if (refvarTRUE | evaluated 16 times by 1 test | FALSE | evaluated 933 times by 1 test |
&& var == 0TRUE | evaluated 13 times by 1 test | FALSE | evaluated 3 times by 1 test |
) | 3-933 |
741 | { | - |
742 | oldname = name; | - |
743 | | - |
744 | namelen = strlen (((refvar)->value)); | - |
745 | | - |
746 | if (subscript_startTRUE | never evaluated | FALSE | evaluated 13 times by 1 test |
) | 0-13 |
747 | { | - |
748 | *subscript_start = '['; | - |
749 | namelen += strlen (subscript_start); | - |
750 | } never executed: end of block | 0 |
751 | | - |
752 | name = sh_xmalloc((namelen + 2 + strlen (value) + 1), "./declare.def", 653); | - |
753 | strcpy (name, ((refvar)->value)); | - |
754 | | - |
755 | if (subscript_startTRUE | never evaluated | FALSE | evaluated 13 times by 1 test |
) | 0-13 |
756 | strcpy (name + strlen (((refvar)->value)), subscript_start); never executed: strcpy (name + strlen (((refvar)->value)), subscript_start); | 0 |
757 | | - |
758 | | - |
759 | if (offsetTRUE | evaluated 6 times by 1 test | FALSE | evaluated 7 times by 1 test |
) | 6-7 |
760 | { | - |
761 | | - |
762 | if (aflags & 0x0001TRUE | evaluated 1 time by 1 test | FALSE | evaluated 5 times by 1 test |
) | 1-5 |
763 | name[namelen++] = '+';executed 1 time by 1 test: name[namelen++] = '+'; | 1 |
764 | name[namelen++] = '='; | - |
765 | if (valueTRUE | evaluated 6 times by 1 test | FALSE | never evaluated |
&& *TRUE | evaluated 4 times by 1 test | FALSE | evaluated 2 times by 1 test |
valueTRUE | evaluated 4 times by 1 test | FALSE | evaluated 2 times by 1 test |
) | 0-6 |
766 | strcpy (name + namelen, value);executed 4 times by 1 test: strcpy (name + namelen, value); | 4 |
767 | else | - |
768 | name[namelen] = '\0';executed 2 times by 1 test: name[namelen] = '\0'; | 2 |
769 | offset = assignment (name, 0); | - |
770 | | - |
771 | | - |
772 | | - |
773 | if (offset == 0TRUE | never evaluated | FALSE | evaluated 6 times by 1 test |
) | 0-6 |
774 | { | - |
775 | sh_xfree((oldname), "./declare.def", 676); | - |
776 | sh_invalidid (name); | - |
777 | assign_error++; | - |
778 | sh_xfree((name), "./declare.def", 679); list = list->next; continue; never executed: continue; | 0 |
779 | } | - |
780 | name[offset] = '\0'; | - |
781 | value = name + namelen; | - |
782 | }executed 6 times by 1 test: end of block | 6 |
783 | sh_xfree((oldname), "./declare.def", 684); | - |
784 | | - |
785 | | - |
786 | | - |
787 | if (flags_off & 0x0000800TRUE | evaluated 1 time by 1 test | FALSE | evaluated 12 times by 1 test |
) | 1-12 |
788 | ((executed 1 time by 1 test: ((refvar)->attributes &= ~(0x0000800)); refvar)->attributes &= ~(0x0000800));executed 1 time by 1 test: ((refvar)->attributes &= ~(0x0000800)); | 1 |
789 | | - |
790 | gotoexecuted 13 times by 1 test: goto restart_new_var_name; restart_new_var_name;executed 13 times by 1 test: goto restart_new_var_name; | 13 |
791 | | - |
792 | } | - |
793 | }executed 936 times by 1 test: end of block | 936 |
794 | if (var == 0TRUE | evaluated 946 times by 1 test | FALSE | evaluated 777 times by 1 test |
) | 777-946 |
795 | var = declare_find_variable (name, mkglobal, chklocal);executed 946 times by 1 test: var = declare_find_variable (name, mkglobal, chklocal); | 946 |
796 | | - |
797 | | - |
798 | var_exists = var != 0; | - |
799 | array_exists = varTRUE | evaluated 1097 times by 1 test | FALSE | evaluated 626 times by 1 test |
&& (((((TRUE | evaluated 157 times by 1 test | FALSE | evaluated 940 times by 1 test |
var)->attributes) & (0x0000004)))TRUE | evaluated 157 times by 1 test | FALSE | evaluated 940 times by 1 test |
|| ((((TRUE | evaluated 39 times by 1 test | FALSE | evaluated 901 times by 1 test |
var)->attributes) & (0x0000040)))TRUE | evaluated 39 times by 1 test | FALSE | evaluated 901 times by 1 test |
); | 39-1097 |
800 | creating_array = flags_on & (0x0000004|0x0000040); | - |
801 | | - |
802 | | - |
803 | if (var == 0TRUE | evaluated 626 times by 1 test | FALSE | evaluated 1097 times by 1 test |
) | 626-1097 |
804 | { | - |
805 | | - |
806 | if (flags_on & 0x0000040TRUE | evaluated 112 times by 1 test | FALSE | evaluated 514 times by 1 test |
) | 112-514 |
807 | { | - |
808 | var = make_new_assoc_variable (name); | - |
809 | if (varTRUE | evaluated 112 times by 1 test | FALSE | never evaluated |
&& offset == 0TRUE | evaluated 104 times by 1 test | FALSE | evaluated 8 times by 1 test |
&& no_invisible_vars == 0TRUE | evaluated 104 times by 1 test | FALSE | never evaluated |
) | 0-112 |
810 | ((executed 104 times by 1 test: ((var)->attributes |= (0x0001000)); var)->attributes |= (0x0001000));executed 104 times by 1 test: ((var)->attributes |= (0x0001000)); | 104 |
811 | }executed 112 times by 1 test: end of block | 112 |
812 | else if ((TRUE | evaluated 181 times by 1 test | FALSE | evaluated 333 times by 1 test |
flags_on & 0x0000004)TRUE | evaluated 181 times by 1 test | FALSE | evaluated 333 times by 1 test |
|| making_array_specialTRUE | evaluated 21 times by 1 test | FALSE | evaluated 312 times by 1 test |
) | 21-333 |
813 | { | - |
814 | var = make_new_array_variable (name); | - |
815 | if (varTRUE | evaluated 202 times by 1 test | FALSE | never evaluated |
&& offset == 0TRUE | evaluated 136 times by 1 test | FALSE | evaluated 66 times by 1 test |
&& no_invisible_vars == 0TRUE | evaluated 136 times by 1 test | FALSE | never evaluated |
) | 0-202 |
816 | ((executed 136 times by 1 test: ((var)->attributes |= (0x0001000)); var)->attributes |= (0x0001000));executed 136 times by 1 test: ((var)->attributes |= (0x0001000)); | 136 |
817 | }executed 202 times by 1 test: end of block | 202 |
818 | else | - |
819 | | - |
820 | { | - |
821 | var = mkglobalTRUE | evaluated 7 times by 1 test | FALSE | evaluated 305 times by 1 test |
? bind_global_variable (name, (char *) | 7-305 |
822 | ((void *)0) | - |
823 | , 0x0020) : bind_variable (name, (char *) | - |
824 | ((void *)0) | - |
825 | , 0x0020); | - |
826 | if (varTRUE | evaluated 311 times by 1 test | FALSE | evaluated 1 time by 1 test |
&& offset == 0TRUE | evaluated 151 times by 1 test | FALSE | evaluated 160 times by 1 test |
&& no_invisible_vars == 0TRUE | evaluated 151 times by 1 test | FALSE | never evaluated |
) | 0-311 |
827 | ((executed 151 times by 1 test: ((var)->attributes |= (0x0001000)); var)->attributes |= (0x0001000));executed 151 times by 1 test: ((var)->attributes |= (0x0001000)); | 151 |
828 | }executed 312 times by 1 test: end of block | 312 |
829 | if (var == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 625 times by 1 test |
) | 1-625 |
830 | { | - |
831 | | - |
832 | sh_xfree((name), "./declare.def", 729); list = list->next; continue;executed 1 time by 1 test: continue; | 1 |
833 | } | - |
834 | created_var = 1; | - |
835 | }executed 625 times by 1 test: end of block | 625 |
836 | | - |
837 | else if ((((((TRUE | evaluated 157 times by 1 test | FALSE | evaluated 940 times by 1 test |
var)->attributes) & (0x0000004)))TRUE | evaluated 157 times by 1 test | FALSE | evaluated 940 times by 1 test |
|| ((((TRUE | evaluated 39 times by 1 test | FALSE | evaluated 901 times by 1 test |
var)->attributes) & (0x0000040)))TRUE | evaluated 39 times by 1 test | FALSE | evaluated 901 times by 1 test |
) && (TRUE | evaluated 6 times by 1 test | FALSE | evaluated 190 times by 1 test |
flags_on & 0x0000800)TRUE | evaluated 6 times by 1 test | FALSE | evaluated 190 times by 1 test |
) | 6-940 |
838 | { | - |
839 | builtin_error ( | - |
840 | dcgettext (((void *)0), | - |
841 | "%s: reference variable cannot be an array" | - |
842 | , 5) | - |
843 | , name); | - |
844 | assign_error++; | - |
845 | sh_xfree((name), "./declare.def", 738); list = list->next; continue;executed 6 times by 1 test: continue; | 6 |
846 | } | - |
847 | else if (((((TRUE | evaluated 44 times by 1 test | FALSE | evaluated 1047 times by 1 test |
var)->attributes) & (0x0000800)))TRUE | evaluated 44 times by 1 test | FALSE | evaluated 1047 times by 1 test |
&& (TRUE | evaluated 2 times by 1 test | FALSE | evaluated 42 times by 1 test |
flags_on & 0x0000800) == 0TRUE | evaluated 2 times by 1 test | FALSE | evaluated 42 times by 1 test |
&& (TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
flags_off & 0x0000800) == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 1 time by 1 test |
&& offsetTRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
&& valid_nameref_value (value, 1) == 0TRUE | evaluated 1 time by 1 test | FALSE | never evaluated |
) | 0-1047 |
848 | { | - |
849 | builtin_error ( | - |
850 | dcgettext (((void *)0), | - |
851 | "`%s': invalid variable name for name reference" | - |
852 | , 5) | - |
853 | , value); | - |
854 | any_failed++; | - |
855 | sh_xfree((name), "./declare.def", 744); list = list->next; continue;executed 1 time by 1 test: continue; | 1 |
856 | } | - |
857 | else if (flags_on & 0x0000800TRUE | evaluated 173 times by 1 test | FALSE | evaluated 917 times by 1 test |
) | 173-917 |
858 | { | - |
859 | | - |
860 | | - |
861 | | - |
862 | if (((((TRUE | evaluated 131 times by 1 test | FALSE | evaluated 42 times by 1 test |
var)->attributes) & (0x0000800))) == 0TRUE | evaluated 131 times by 1 test | FALSE | evaluated 42 times by 1 test |
&& ((TRUE | evaluated 61 times by 1 test | FALSE | evaluated 70 times by 1 test |
var)->value != 0)TRUE | evaluated 61 times by 1 test | FALSE | evaluated 70 times by 1 test |
&& offset == 0TRUE | evaluated 58 times by 1 test | FALSE | evaluated 3 times by 1 test |
&& valid_nameref_value (((var)->value), 0) == 0TRUE | evaluated 42 times by 1 test | FALSE | evaluated 16 times by 1 test |
) | 3-131 |
863 | { | - |
864 | builtin_error ( | - |
865 | dcgettext (((void *)0), | - |
866 | "`%s': invalid variable name for name reference" | - |
867 | , 5) | - |
868 | , ((var)->value)); | - |
869 | any_failed++; | - |
870 | sh_xfree((name), "./declare.def", 755); list = list->next; continue;executed 42 times by 1 test: continue; | 42 |
871 | } | - |
872 | | - |
873 | if (((((TRUE | evaluated 7 times by 1 test | FALSE | evaluated 124 times by 1 test |
var)->attributes) & (0x0000002)))TRUE | evaluated 7 times by 1 test | FALSE | evaluated 124 times by 1 test |
) | 7-124 |
874 | { | - |
875 | sh_readonly (name); | - |
876 | any_failed++; | - |
877 | sh_xfree((name), "./declare.def", 762); list = list->next; continue;executed 7 times by 1 test: continue; | 7 |
878 | } | - |
879 | | - |
880 | ((var)->attributes &= ~(0x0000010|0x0000100|0x0000200|0x0000400)); | - |
881 | }executed 124 times by 1 test: end of block | 124 |
882 | | - |
883 | | - |
884 | if (((((TRUE | evaluated 28 times by 1 test | FALSE | evaluated 1638 times by 1 test |
var)->attributes) & (0x0000002)))TRUE | evaluated 28 times by 1 test | FALSE | evaluated 1638 times by 1 test |
&& (TRUE | evaluated 5 times by 1 test | FALSE | evaluated 23 times by 1 test |
flags_off & 0x0000002)TRUE | evaluated 5 times by 1 test | FALSE | evaluated 23 times by 1 test |
) | 5-1638 |
885 | { | - |
886 | sh_readonly (((var)->name)); | - |
887 | any_failed++; | - |
888 | sh_xfree((name), "./declare.def", 773); list = list->next; continue;executed 5 times by 1 test: continue; | 5 |
889 | } | - |
890 | | - |
891 | | - |
892 | | - |
893 | if ((((((TRUE | evaluated 23 times by 1 test | FALSE | evaluated 1638 times by 1 test |
var)->attributes) & (0x0000002)))TRUE | evaluated 23 times by 1 test | FALSE | evaluated 1638 times by 1 test |
|| ((((TRUE | never evaluated | FALSE | evaluated 1638 times by 1 test |
var)->attributes) & (0x0004000)))TRUE | never evaluated | FALSE | evaluated 1638 times by 1 test |
) && offsetTRUE | evaluated 6 times by 1 test | FALSE | evaluated 17 times by 1 test |
) | 0-1638 |
894 | { | - |
895 | if (((((TRUE | evaluated 6 times by 1 test | FALSE | never evaluated |
var)->attributes) & (0x0000002)))TRUE | evaluated 6 times by 1 test | FALSE | never evaluated |
) | 0-6 |
896 | sh_readonly (name);executed 6 times by 1 test: sh_readonly (name); | 6 |
897 | assign_error++; | - |
898 | sh_xfree((name), "./declare.def", 783); list = list->next; continue;executed 6 times by 1 test: continue; | 6 |
899 | } | - |
900 | | - |
901 | | - |
902 | | - |
903 | | - |
904 | if (array_subscript_assignmentTRUE | evaluated 57 times by 1 test | FALSE | evaluated 1598 times by 1 test |
&& array_existsTRUE | evaluated 38 times by 1 test | FALSE | evaluated 19 times by 1 test |
&& creating_array == 0TRUE | evaluated 27 times by 1 test | FALSE | evaluated 11 times by 1 test |
) | 11-1598 |
905 | simple_array_assign = 1;executed 27 times by 1 test: simple_array_assign = 1; | 27 |
906 | else if ((making_array_specialTRUE | evaluated 65 times by 1 test | FALSE | evaluated 1563 times by 1 test |
|| creating_arrayTRUE | evaluated 374 times by 1 test | FALSE | evaluated 1189 times by 1 test |
|| array_existsTRUE | evaluated 55 times by 1 test | FALSE | evaluated 1134 times by 1 test |
) && offsetTRUE | evaluated 111 times by 1 test | FALSE | evaluated 383 times by 1 test |
) | 55-1563 |
907 | { | - |
908 | int vlen; | - |
909 | vlen = (((TRUE | evaluated 111 times by 1 test | FALSE | never evaluated |
value)TRUE | evaluated 111 times by 1 test | FALSE | never evaluated |
&& (TRUE | evaluated 110 times by 1 test | FALSE | evaluated 1 time by 1 test |
value)[0]TRUE | evaluated 110 times by 1 test | FALSE | evaluated 1 time by 1 test |
) ? ((TRUE | evaluated 107 times by 1 test | FALSE | evaluated 3 times by 1 test |
value)[1]TRUE | evaluated 107 times by 1 test | FALSE | evaluated 3 times by 1 test |
? ((TRUE | evaluated 107 times by 1 test | FALSE | never evaluated |
value)[2]TRUE | evaluated 107 times by 1 test | FALSE | never evaluated |
? strlen(value) : 2) : 1) : 0); | 0-111 |
910 | | - |
911 | if (shell_compatibility_level > 43TRUE | evaluated 111 times by 1 test | FALSE | never evaluated |
&& (TRUE | evaluated 111 times by 1 test | FALSE | never evaluated |
wflags & 0x008000) == 0TRUE | evaluated 111 times by 1 test | FALSE | never evaluated |
&& | 0-111 |
912 | value[0] == '('TRUE | evaluated 82 times by 1 test | FALSE | evaluated 29 times by 1 test |
&& value[vlen-1] == ')'TRUE | evaluated 82 times by 1 test | FALSE | never evaluated |
) | 0-82 |
913 | { | - |
914 | | - |
915 | | - |
916 | | - |
917 | | - |
918 | if (array_exists == 0TRUE | evaluated 49 times by 1 test | FALSE | evaluated 33 times by 1 test |
&& creating_array == 0TRUE | evaluated 2 times by 1 test | FALSE | evaluated 47 times by 1 test |
) | 2-49 |
919 | internal_warning (executed 2 times by 1 test: internal_warning ( dcgettext (((void *)0), "%s: quoted compound array assignment deprecated" , 5) , list->word->word); | 2 |
920 | dcgettext (((void *)0), executed 2 times by 1 test: internal_warning ( dcgettext (((void *)0), "%s: quoted compound array assignment deprecated" , 5) , list->word->word); | 2 |
921 | "%s: quoted compound array assignment deprecated"executed 2 times by 1 test: internal_warning ( dcgettext (((void *)0), "%s: quoted compound array assignment deprecated" , 5) , list->word->word); | 2 |
922 | , 5)executed 2 times by 1 test: internal_warning ( dcgettext (((void *)0), "%s: quoted compound array assignment deprecated" , 5) , list->word->word); | 2 |
923 | , list->word->word);executed 2 times by 1 test: internal_warning ( dcgettext (((void *)0), "%s: quoted compound array assignment deprecated" , 5) , list->word->word); | 2 |
924 | compound_array_assign = array_existsTRUE | evaluated 33 times by 1 test | FALSE | evaluated 49 times by 1 test |
|| creating_arrayTRUE | evaluated 47 times by 1 test | FALSE | evaluated 2 times by 1 test |
; | 2-49 |
925 | simple_array_assign = making_array_special; | - |
926 | }executed 82 times by 1 test: end of block | 82 |
927 | else if (value[0] == '('TRUE | never evaluated | FALSE | evaluated 29 times by 1 test |
&& value[vlen-1] == ')'TRUE | never evaluated | FALSE | never evaluated |
&& (shell_compatibility_level < 44TRUE | never evaluated | FALSE | never evaluated |
|| (TRUE | never evaluated | FALSE | never evaluated |
wflags & 0x008000)TRUE | never evaluated | FALSE | never evaluated |
)) | 0-29 |
928 | compound_array_assign = 1; never executed: compound_array_assign = 1; | 0 |
929 | else | - |
930 | simple_array_assign = 1;executed 29 times by 1 test: simple_array_assign = 1; | 29 |
931 | } | - |
932 | | - |
933 | | - |
934 | | - |
935 | if (((TRUE | evaluated 18 times by 1 test | FALSE | evaluated 1637 times by 1 test |
flags_off & 0x0000004)TRUE | evaluated 18 times by 1 test | FALSE | evaluated 1637 times by 1 test |
&& ((((TRUE | evaluated 9 times by 1 test | FALSE | evaluated 9 times by 1 test |
var)->attributes) & (0x0000004)))TRUE | evaluated 9 times by 1 test | FALSE | evaluated 9 times by 1 test |
) || ((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 1644 times by 1 test |
flags_off & 0x0000040)TRUE | evaluated 2 times by 1 test | FALSE | evaluated 1644 times by 1 test |
&& ((((TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
var)->attributes) & (0x0000040)))TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
)) | 0-1644 |
936 | { | - |
937 | builtin_error ( | - |
938 | dcgettext (((void *)0), | - |
939 | "%s: cannot destroy array variables in this way" | - |
940 | , 5) | - |
941 | , name); | - |
942 | any_failed++; | - |
943 | sh_xfree((name), "./declare.def", 820); list = list->next; continue;executed 11 times by 1 test: continue; | 11 |
944 | } | - |
945 | | - |
946 | if ((TRUE | evaluated 281 times by 1 test | FALSE | evaluated 1363 times by 1 test |
flags_on & 0x0000004)TRUE | evaluated 281 times by 1 test | FALSE | evaluated 1363 times by 1 test |
&& ((((TRUE | never evaluated | FALSE | evaluated 281 times by 1 test |
var)->attributes) & (0x0000040)))TRUE | never evaluated | FALSE | evaluated 281 times by 1 test |
) | 0-1363 |
947 | { | - |
948 | builtin_error ( | - |
949 | dcgettext (((void *)0), | - |
950 | "%s: cannot convert associative to indexed array" | - |
951 | , 5) | - |
952 | , name); | - |
953 | any_failed++; | - |
954 | sh_xfree((name), "./declare.def", 827); list = list->next; continue; never executed: continue; | 0 |
955 | } | - |
956 | if ((TRUE | evaluated 135 times by 1 test | FALSE | evaluated 1509 times by 1 test |
flags_on & 0x0000040)TRUE | evaluated 135 times by 1 test | FALSE | evaluated 1509 times by 1 test |
&& ((((TRUE | evaluated 1 time by 1 test | FALSE | evaluated 134 times by 1 test |
var)->attributes) & (0x0000004)))TRUE | evaluated 1 time by 1 test | FALSE | evaluated 134 times by 1 test |
) | 1-1509 |
957 | { | - |
958 | builtin_error ( | - |
959 | dcgettext (((void *)0), | - |
960 | "%s: cannot convert indexed to associative array" | - |
961 | , 5) | - |
962 | , name); | - |
963 | any_failed++; | - |
964 | sh_xfree((name), "./declare.def", 833); list = list->next; continue;executed 1 time by 1 test: continue; | 1 |
965 | } | - |
966 | | - |
967 | | - |
968 | if (flags_on & 0x0000040TRUE | evaluated 134 times by 1 test | FALSE | evaluated 1509 times by 1 test |
) | 134-1509 |
969 | { | - |
970 | if (((((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 132 times by 1 test |
var)->attributes) & (0x0000040))) == 0TRUE | evaluated 2 times by 1 test | FALSE | evaluated 132 times by 1 test |
) | 2-132 |
971 | var = convert_var_to_assoc (var);executed 2 times by 1 test: var = convert_var_to_assoc (var); | 2 |
972 | }executed 134 times by 1 test: end of block | 134 |
973 | | - |
974 | | - |
975 | else if ((making_array_specialTRUE | evaluated 87 times by 1 test | FALSE | evaluated 1422 times by 1 test |
|| (TRUE | evaluated 244 times by 1 test | FALSE | evaluated 1178 times by 1 test |
flags_on & 0x0000004)TRUE | evaluated 244 times by 1 test | FALSE | evaluated 1178 times by 1 test |
) && ((((TRUE | evaluated 22 times by 1 test | FALSE | evaluated 309 times by 1 test |
var)->attributes) & (0x0000004))) == 0TRUE | evaluated 22 times by 1 test | FALSE | evaluated 309 times by 1 test |
&& ((((TRUE | evaluated 17 times by 1 test | FALSE | evaluated 5 times by 1 test |
var)->attributes) & (0x0000040))) == 0TRUE | evaluated 17 times by 1 test | FALSE | evaluated 5 times by 1 test |
) | 5-1422 |
976 | var = convert_var_to_array (var);executed 17 times by 1 test: var = convert_var_to_array (var); | 17 |
977 | onref = (flags_on & 0x0000800); | - |
978 | flags_on &= ~0x0000800; | - |
979 | | - |
980 | if (((((TRUE | evaluated 358 times by 1 test | FALSE | evaluated 1285 times by 1 test |
var)->attributes) & (0x0000004)))TRUE | evaluated 358 times by 1 test | FALSE | evaluated 1285 times by 1 test |
|| ((((TRUE | evaluated 151 times by 1 test | FALSE | evaluated 1134 times by 1 test |
var)->attributes) & (0x0000040)))TRUE | evaluated 151 times by 1 test | FALSE | evaluated 1134 times by 1 test |
| 151-1285 |
981 | || (offsetTRUE | evaluated 659 times by 1 test | FALSE | evaluated 475 times by 1 test |
&& compound_array_assignTRUE | never evaluated | FALSE | evaluated 659 times by 1 test |
) | 0-659 |
982 | || simple_array_assignTRUE | never evaluated | FALSE | evaluated 1134 times by 1 test |
) | 0-1134 |
983 | onref = 0;executed 509 times by 1 test: onref = 0; | 509 |
984 | | - |
985 | | - |
986 | | - |
987 | offref = (flags_off & 0x0000800); | - |
988 | flags_off &= ~0x0000800; | - |
989 | | - |
990 | ((var)->attributes |= (flags_on)); | - |
991 | ((var)->attributes &= ~(flags_off)); | - |
992 | | - |
993 | | - |
994 | if (offsetTRUE | evaluated 797 times by 1 test | FALSE | evaluated 846 times by 1 test |
&& compound_array_assignTRUE | evaluated 80 times by 1 test | FALSE | evaluated 717 times by 1 test |
) | 80-846 |
995 | assign_array_var_from_string (var, value, aflags|0x0020);executed 80 times by 1 test: assign_array_var_from_string (var, value, aflags|0x0020); | 80 |
996 | else if (simple_array_assignTRUE | evaluated 58 times by 1 test | FALSE | evaluated 1505 times by 1 test |
&& subscript_startTRUE | evaluated 46 times by 1 test | FALSE | evaluated 12 times by 1 test |
) | 12-1505 |
997 | { | - |
998 | int local_aflags; | - |
999 | | - |
1000 | *subscript_start = '['; | - |
1001 | | - |
1002 | local_aflags = aflags&0x0001; | - |
1003 | local_aflags |= assoc_noexpandTRUE | evaluated 1 time by 1 test | FALSE | evaluated 45 times by 1 test |
? 0x0080 : 0; | 1-45 |
1004 | var = assign_array_element (name, value, local_aflags); | - |
1005 | *subscript_start = '\0'; | - |
1006 | if (var == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 45 times by 1 test |
) | 1-45 |
1007 | { | - |
1008 | assign_error++; | - |
1009 | flags_on |= onref; | - |
1010 | flags_off |= offref; | - |
1011 | sh_xfree((name), "./declare.def", 888); list = list->next; continue;executed 1 time by 1 test: continue; | 1 |
1012 | } | - |
1013 | }executed 45 times by 1 test: end of block | 45 |
1014 | else if (simple_array_assignTRUE | evaluated 12 times by 1 test | FALSE | evaluated 1505 times by 1 test |
) | 12-1505 |
1015 | { | - |
1016 | | - |
1017 | if (((((TRUE | evaluated 2 times by 1 test | FALSE | evaluated 10 times by 1 test |
var)->attributes) & (0x0000040)))TRUE | evaluated 2 times by 1 test | FALSE | evaluated 10 times by 1 test |
) | 2-10 |
1018 | bind_assoc_variable (var, name, (char *)strcpy (sh_xmalloc((1 + strlen ("0")), "./declare.def", 895), ("0")), value, aflags|0x0020);executed 2 times by 1 test: bind_assoc_variable (var, name, (char *)strcpy (sh_xmalloc((1 + strlen ("0")), "./declare.def", 895), ("0")), value, aflags|0x0020); | 2 |
1019 | else | - |
1020 | bind_array_variable (name, 0, value, aflags|0x0020);executed 10 times by 1 test: bind_array_variable (name, 0, value, aflags|0x0020); | 10 |
1021 | } | - |
1022 | else | - |
1023 | | - |
1024 | | - |
1025 | | - |
1026 | | - |
1027 | if (offsetTRUE | evaluated 659 times by 1 test | FALSE | evaluated 846 times by 1 test |
) | 659-846 |
1028 | { | - |
1029 | if (onrefTRUE | evaluated 166 times by 1 test | FALSE | evaluated 493 times by 1 test |
|| ((((TRUE | evaluated 8 times by 1 test | FALSE | evaluated 485 times by 1 test |
var)->attributes) & (0x0000800)))TRUE | evaluated 8 times by 1 test | FALSE | evaluated 485 times by 1 test |
) | 8-493 |
1030 | aflags |= 0x0010;executed 174 times by 1 test: aflags |= 0x0010; | 174 |
1031 | v = bind_variable_value (var, value, aflags); | - |
1032 | if (v == 0TRUE | evaluated 14 times by 1 test | FALSE | evaluated 645 times by 1 test |
&& (onrefTRUE | evaluated 6 times by 1 test | FALSE | evaluated 8 times by 1 test |
|| ((((TRUE | evaluated 8 times by 1 test | FALSE | never evaluated |
var)->attributes) & (0x0000800)))TRUE | evaluated 8 times by 1 test | FALSE | never evaluated |
)) | 0-645 |
1033 | { | - |
1034 | if (valid_nameref_value (value, 1) == 0TRUE | evaluated 13 times by 1 test | FALSE | evaluated 1 time by 1 test |
) | 1-13 |
1035 | sh_invalidid (value);executed 13 times by 1 test: sh_invalidid (value); | 13 |
1036 | assign_error++; | - |
1037 | | - |
1038 | if (created_varTRUE | evaluated 8 times by 1 test | FALSE | evaluated 6 times by 1 test |
) | 6-8 |
1039 | delete_var (var->name, mkglobal ? global_variables : shell_variables);executed 8 times by 1 test: delete_var (var->name, mkglobal ? global_variables : shell_variables); | 8 |
1040 | flags_on |= onref; | - |
1041 | flags_off |= offref; | - |
1042 | sh_xfree((name), "./declare.def", 919); list = list->next; continue;executed 14 times by 1 test: continue; | 14 |
1043 | } | - |
1044 | }executed 645 times by 1 test: end of block | 645 |
1045 | if ((TRUE | evaluated 86 times by 1 test | FALSE | evaluated 1538 times by 1 test |
flags_on & (0x0000001|0x0000002))TRUE | evaluated 86 times by 1 test | FALSE | evaluated 1538 times by 1 test |
&& ((((TRUE | evaluated 10 times by 1 test | FALSE | evaluated 76 times by 1 test |
var)->attributes) & (0x0100000)))TRUE | evaluated 10 times by 1 test | FALSE | evaluated 76 times by 1 test |
) | 10-1538 |
1046 | { | - |
1047 | SHELL_VAR *tv; | - |
1048 | char *tvalue; | - |
1049 | | - |
1050 | tv = find_tempenv_variable (var->name); | - |
1051 | if (tvTRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
) | 0-10 |
1052 | { | - |
1053 | tvalue = ((TRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
var)->value != 0)TRUE | evaluated 10 times by 1 test | FALSE | never evaluated |
? (char *)strcpy (sh_xmalloc((1 + strlen (((var)->value))), "./declare.def", 940), (((var)->value))) : (char *)strcpy (sh_xmalloc((1 + strlen ("")), "./declare.def", 940), ("")); | 0-10 |
1054 | tv = bind_variable (var->name, tvalue, 0); | - |
1055 | tv->attributes |= var->attributes & ~0x0100000; | - |
1056 | if (tv->context > 0TRUE | never evaluated | FALSE | evaluated 10 times by 1 test |
) | 0-10 |
1057 | (( never executed: ((tv)->attributes |= (0x0200000)); tv)->attributes |= (0x0200000));never executed: ((tv)->attributes |= (0x0200000)); | 0 |
1058 | sh_xfree((tvalue), "./declare.def", 945); | - |
1059 | }executed 10 times by 1 test: end of block | 10 |
1060 | ((var)->attributes |= (0x0200000)); | - |
1061 | }executed 10 times by 1 test: end of block | 10 |
1062 | }executed 1624 times by 1 test: end of block | 1624 |
1063 | | - |
1064 | | - |
1065 | | - |
1066 | | - |
1067 | ((var)->attributes |= (onref)); | - |
1068 | flags_on |= onref; | - |
1069 | ((var)->attributes &= ~(offref)); | - |
1070 | flags_off |= offref; | - |
1071 | | - |
1072 | | - |
1073 | | - |
1074 | | - |
1075 | if (refvarTRUE | evaluated 9 times by 1 test | FALSE | evaluated 1615 times by 1 test |
) | 9-1615 |
1076 | { | - |
1077 | if (flags_off & 0x0000002TRUE | never evaluated | FALSE | evaluated 9 times by 1 test |
) | 0-9 |
1078 | flags_off &= ~0x0000002; never executed: flags_off &= ~0x0000002; | 0 |
1079 | ((refvar)->attributes &= ~(flags_off)); | - |
1080 | }executed 9 times by 1 test: end of block | 9 |
1081 | | - |
1082 | stupidly_hack_special_variables (name); | - |
1083 | | - |
1084 | sh_xfree((name), "./declare.def", 971); list = list->next; continue;executed 1624 times by 1 test: continue; | 1624 |
1085 | } | - |
1086 | | - |
1087 | returnexecuted 1572 times by 1 test: return (assign_error ? 260 : ((any_failed == 0) ? 0 : 1)); (assign_error ? 260executed 1572 times by 1 test: return (assign_error ? 260 : ((any_failed == 0) ? 0 : 1)); | 1572 |
1088 | : ((any_failed == 0) ? 0executed 1572 times by 1 test: return (assign_error ? 260 : ((any_failed == 0) ? 0 : 1)); | 1572 |
1089 | : 1));executed 1572 times by 1 test: return (assign_error ? 260 : ((any_failed == 0) ? 0 : 1)); | 1572 |
1090 | } | - |
| | |