OpenCoverage

shopt.def

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/shopt.def
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24extern int allow_null_glob_expansion, fail_glob_expansion, glob_dot_filenames;-
25extern int cdable_vars, mail_warning, source_uses_path;-
26extern int no_exit_on_failed_exec, print_shift_error;-
27extern int check_hashed_filenames, promptvars;-
28extern int cdspelling, expand_aliases;-
29extern int extended_quote;-
30extern int check_window_size;-
31extern int glob_ignore_case, match_ignore_case;-
32extern int hup_on_exit;-
33extern int xpg_echo;-
34extern int gnu_error_format;-
35extern int check_jobs_at_exit;-
36extern int autocd;-
37extern int glob_star;-
38extern int glob_asciirange;-
39extern int lastpipe_opt;-
40extern int inherit_errexit;-
41extern int localvar_inherit;-
42extern int localvar_unset;-
43-
44-
45extern int extended_glob;-
46-
47-
48-
49extern int hist_verify, history_reediting, perform_hostname_completion;-
50extern int no_empty_command_completion;-
51extern int force_fignore;-
52extern int dircomplete_spelling, dircomplete_expand;-
53extern int complete_fullquote;-
54-
55extern int enable_hostname_completion (int);-
56-
57-
58-
59extern int prog_completion_enabled;-
60-
61-
62-
63extern int debugging_mode;-
64-
65-
66-
67extern int assoc_expand_once;-
68extern int array_expand_once;-
69-
70-
71static void shopt_error (char *);-
72-
73static int set_shellopts_after_change (char *, int);-
74static int set_compatibility_level (char *, int);-
75-
76-
77static int set_restricted_shell (char *, int);-
78-
79-
80-
81static int shopt_enable_hostname_completion (char *, int);-
82static int shopt_set_complete_direxpand (char *, int);-
83-
84-
85static int shopt_set_debug_mode (char *, int);-
86-
87static int shopt_login_shell;-
88static int shopt_compat31;-
89static int shopt_compat32;-
90static int shopt_compat40;-
91static int shopt_compat41;-
92static int shopt_compat42;-
93static int shopt_compat43;-
94static int shopt_compat44;-
95-
96typedef int shopt_set_func_t (char *, int);-
97-
98-
99-
100-
101static struct {-
102 char *name;-
103 int *value;-
104 shopt_set_func_t *set_func;-
105} shopt_vars[] = {-
106 { "autocd", &autocd, (shopt_set_func_t *)-
107 ((void *)0) -
108 },-
109-
110 { "assoc_expand_once", &assoc_expand_once, (shopt_set_func_t *)-
111 ((void *)0) -
112 },-
113-
114 { "cdable_vars", &cdable_vars, (shopt_set_func_t *)-
115 ((void *)0) -
116 },-
117 { "cdspell", &cdspelling, (shopt_set_func_t *)-
118 ((void *)0) -
119 },-
120 { "checkhash", &check_hashed_filenames, (shopt_set_func_t *)-
121 ((void *)0) -
122 },-
123-
124 { "checkjobs", &check_jobs_at_exit, (shopt_set_func_t *)-
125 ((void *)0) -
126 },-
127-
128 { "checkwinsize", &check_window_size, (shopt_set_func_t *)-
129 ((void *)0) -
130 },-
131-
132 { "cmdhist", &command_oriented_history, (shopt_set_func_t *)-
133 ((void *)0) -
134 },-
135-
136 { "compat31", &shopt_compat31, set_compatibility_level },-
137 { "compat32", &shopt_compat32, set_compatibility_level },-
138 { "compat40", &shopt_compat40, set_compatibility_level },-
139 { "compat41", &shopt_compat41, set_compatibility_level },-
140 { "compat42", &shopt_compat42, set_compatibility_level },-
141 { "compat43", &shopt_compat43, set_compatibility_level },-
142 { "compat44", &shopt_compat44, set_compatibility_level },-
143-
144 { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)-
145 ((void *)0)-
146 },-
147 { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },-
148 { "dirspell", &dircomplete_spelling, (shopt_set_func_t *)-
149 ((void *)0) -
150 },-
151-
152 { "dotglob", &glob_dot_filenames, (shopt_set_func_t *)-
153 ((void *)0) -
154 },-
155 { "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)-
156 ((void *)0) -
157 },-
158 { "expand_aliases", &expand_aliases, (shopt_set_func_t *)-
159 ((void *)0) -
160 },-
161-
162 { "extdebug", &debugging_mode, shopt_set_debug_mode },-
163-
164-
165 { "extglob", &extended_glob, (shopt_set_func_t *)-
166 ((void *)0) -
167 },-
168-
169 { "extquote", &extended_quote, (shopt_set_func_t *)-
170 ((void *)0) -
171 },-
172 { "failglob", &fail_glob_expansion, (shopt_set_func_t *)-
173 ((void *)0) -
174 },-
175-
176 { "force_fignore", &force_fignore, (shopt_set_func_t *)-
177 ((void *)0) -
178 },-
179-
180 { "globasciiranges", &glob_asciirange, (shopt_set_func_t *)-
181 ((void *)0) -
182 },-
183 { "globstar", &glob_star, (shopt_set_func_t *)-
184 ((void *)0) -
185 },-
186 { "gnu_errfmt", &gnu_error_format, (shopt_set_func_t *)-
187 ((void *)0) -
188 },-
189-
190 { "histappend", &force_append_history, (shopt_set_func_t *)-
191 ((void *)0) -
192 },-
193-
194-
195 { "histreedit", &history_reediting, (shopt_set_func_t *)-
196 ((void *)0) -
197 },-
198 { "histverify", &hist_verify, (shopt_set_func_t *)-
199 ((void *)0) -
200 },-
201 { "hostcomplete", &perform_hostname_completion, shopt_enable_hostname_completion },-
202-
203 { "huponexit", &hup_on_exit, (shopt_set_func_t *)-
204 ((void *)0) -
205 },-
206 { "inherit_errexit", &inherit_errexit, (shopt_set_func_t *)-
207 ((void *)0) -
208 },-
209 { "interactive_comments", &interactive_comments, set_shellopts_after_change },-
210 { "lastpipe", &lastpipe_opt, (shopt_set_func_t *)-
211 ((void *)0) -
212 },-
213-
214 { "lithist", &literal_history, (shopt_set_func_t *)-
215 ((void *)0) -
216 },-
217-
218 { "localvar_inherit", &localvar_inherit, (shopt_set_func_t *)-
219 ((void *)0) -
220 },-
221-
222-
223-
224 { "login_shell", &shopt_login_shell, set_login_shell },-
225 { "mailwarn", &mail_warning, (shopt_set_func_t *)-
226 ((void *)0) -
227 },-
228-
229 { "no_empty_cmd_completion", &no_empty_command_completion, (shopt_set_func_t *)-
230 ((void *)0) -
231 },-
232-
233 { "nocaseglob", &glob_ignore_case, (shopt_set_func_t *)-
234 ((void *)0) -
235 },-
236 { "nocasematch", &match_ignore_case, (shopt_set_func_t *)-
237 ((void *)0) -
238 },-
239 { "nullglob", &allow_null_glob_expansion, (shopt_set_func_t *)-
240 ((void *)0) -
241 },-
242-
243 { "progcomp", &prog_completion_enabled, (shopt_set_func_t *)-
244 ((void *)0) -
245 },-
246-
247 { "promptvars", &promptvars, (shopt_set_func_t *)-
248 ((void *)0) -
249 },-
250-
251 { "restricted_shell", &restricted_shell, set_restricted_shell },-
252-
253 { "shift_verbose", &print_shift_error, (shopt_set_func_t *)-
254 ((void *)0) -
255 },-
256 { "sourcepath", &source_uses_path, (shopt_set_func_t *)-
257 ((void *)0) -
258 },-
259 { "xpg_echo", &xpg_echo, (shopt_set_func_t *)-
260 ((void *)0) -
261 },-
262 { (char *)0, (int *)0, (shopt_set_func_t *)-
263 ((void *)0) -
264 }-
265};-
266-
267-
268-
269-
270-
271static const char * const on = "on";-
272static const char * const off = "off";-
273-
274static int find_shopt (char *);-
275static int toggle_shopts (int, WORD_LIST *, int);-
276static void print_shopt (char *, int, int);-
277static int list_shopts (WORD_LIST *, int);-
278static int list_some_shopts (int, int);-
279static int list_shopt_o_options (WORD_LIST *, int);-
280static int list_some_o_options (int, int);-
281static int set_shopt_o_options (int, WORD_LIST *, int);-
282-
283-
284-
285-
286-
287-
288-
289int-
290shopt_builtin (list)-
291 WORD_LIST *list;-
292{-
293 int opt, flags, rval;-
294-
295 flags = 0;-
296 reset_internal_getopt ();-
297 while ((
(opt = interna...psuoq")) != -1Description
TRUEevaluated 268 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 256 times by 1 test
Evaluated by:
  • Self test
opt = internal_getopt (list, "psuoq")) != -1
(opt = interna...psuoq")) != -1Description
TRUEevaluated 268 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 256 times by 1 test
Evaluated by:
  • Self test
)
256-268
298 {-
299 switch (opt)-
300 {-
301 case
executed 146 times by 1 test: case 's':
Executed by:
  • Self test
's':
executed 146 times by 1 test: case 's':
Executed by:
  • Self test
146
302 flags |= 0x01;-
303 break;
executed 146 times by 1 test: break;
Executed by:
  • Self test
146
304 case
executed 89 times by 1 test: case 'u':
Executed by:
  • Self test
'u':
executed 89 times by 1 test: case 'u':
Executed by:
  • Self test
89
305 flags |= 0x02;-
306 break;
executed 89 times by 1 test: break;
Executed by:
  • Self test
89
307 case
executed 6 times by 1 test: case 'q':
Executed by:
  • Self test
'q':
executed 6 times by 1 test: case 'q':
Executed by:
  • Self test
6
308 flags |= 0x04;-
309 break;
executed 6 times by 1 test: break;
Executed by:
  • Self test
6
310 case
executed 13 times by 1 test: case 'o':
Executed by:
  • Self test
'o':
executed 13 times by 1 test: case 'o':
Executed by:
  • Self test
13
311 flags |= 0x08;-
312 break;
executed 13 times by 1 test: break;
Executed by:
  • Self test
13
313 case
executed 13 times by 1 test: case 'p':
Executed by:
  • Self test
'p':
executed 13 times by 1 test: case 'p':
Executed by:
  • Self test
13
314 flags |= 0x10;-
315 break;
executed 13 times by 1 test: break;
Executed by:
  • Self test
13
316 case
never executed: case -99:
-99:
never executed: case -99:
builtin_help (); return
never executed: return (258);
(258);
never executed: return (258);
0
317 default
executed 1 time by 1 test: default:
Executed by:
  • Self test
:
executed 1 time by 1 test: default:
Executed by:
  • Self test
1
318 builtin_usage ();-
319 return
executed 1 time by 1 test: return (258);
Executed by:
  • Self test
(258);
executed 1 time by 1 test: return (258);
Executed by:
  • Self test
1
320 }-
321 }-
322 list = loptend;-
323-
324 if ((
(flags & (0x01...== (0x01|0x02)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 255 times by 1 test
Evaluated by:
  • Self test
flags & (0x01|0x02)) == (0x01|0x02)
(flags & (0x01...== (0x01|0x02)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 255 times by 1 test
Evaluated by:
  • Self test
)
1-255
325 {-
326 builtin_error (-
327 dcgettext (((void *)0), -
328 "cannot set and unset shell options simultaneously"-
329 , 5)-
330 );-
331 return
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
1
332 }-
333-
334 rval = 0;-
335 if ((
(flags & 0x08)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 242 times by 1 test
Evaluated by:
  • Self test
flags & 0x08)
(flags & 0x08)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 242 times by 1 test
Evaluated by:
  • Self test
&& ((
((flags & (0x01|0x02)) == 0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
flags & (0x01|0x02)) == 0)
((flags & (0x01|0x02)) == 0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
)
6-242
336 rval = list_shopt_o_options (list, flags);
executed 7 times by 1 test: rval = list_shopt_o_options (list, flags);
Executed by:
  • Self test
7
337 else if (list
listDescription
TRUEevaluated 241 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
&& (
(flags & 0x08)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 238 times by 1 test
Evaluated by:
  • Self test
flags & 0x08)
(flags & 0x08)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 238 times by 1 test
Evaluated by:
  • Self test
)
3-241
338 rval = set_shopt_o_options ((flags & 0x01) ? '-' : '+', list, flags & 0x04);
executed 3 times by 1 test: rval = set_shopt_o_options ((flags & 0x01) ? '-' : '+', list, flags & 0x04);
Executed by:
  • Self test
3
339 else if (flags & 0x08
flags & 0x08Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 242 times by 1 test
Evaluated by:
  • Self test
)
3-242
340 rval = list_some_o_options ((flags & 0x01) ? 1 : 0, flags);
executed 3 times by 1 test: rval = list_some_o_options ((flags & 0x01) ? 1 : 0, flags);
Executed by:
  • Self test
3
341 else if (list
listDescription
TRUEevaluated 238 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test
&& (
(flags & (0x01|0x02))Description
TRUEevaluated 224 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
flags & (0x01|0x02))
(flags & (0x01|0x02))Description
TRUEevaluated 224 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
)
4-238
342 rval = toggle_shopts ((flags & 0x01) ? 1 : 0, list, flags & 0x04);
executed 224 times by 1 test: rval = toggle_shopts ((flags & 0x01) ? 1 : 0, list, flags & 0x04);
Executed by:
  • Self test
224
343 else if ((
(flags & (0x01|0x02)) == 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
flags & (0x01|0x02)) == 0
(flags & (0x01|0x02)) == 0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
3-15
344 rval = list_shopts (list, flags);
executed 15 times by 1 test: rval = list_shopts (list, flags);
Executed by:
  • Self test
15
345 else-
346 rval = list_some_shopts ((flags & 0x01) ? 1 : 0, flags);
executed 3 times by 1 test: rval = list_some_shopts ((flags & 0x01) ? 1 : 0, flags);
Executed by:
  • Self test
3
347 return
executed 255 times by 1 test: return (rval);
Executed by:
  • Self test
(rval);
executed 255 times by 1 test: return (rval);
Executed by:
  • Self test
255
348}-
349-
350-
351-
352void-
353reset_shopt_options ()-
354{-
355 autocd = cdable_vars = cdspelling = 0;-
356 check_hashed_filenames = 0;-
357 check_window_size = 0;-
358 allow_null_glob_expansion = glob_dot_filenames = 0;-
359 no_exit_on_failed_exec = 0;-
360 expand_aliases = 0;-
361 extended_quote = 1;-
362 fail_glob_expansion = 0;-
363 glob_asciirange = 0;-
364 glob_star = 0;-
365 gnu_error_format = 0;-
366 hup_on_exit = 0;-
367 inherit_errexit = 0;-
368 interactive_comments = 1;-
369 lastpipe_opt = 0;-
370 mail_warning = 0;-
371 glob_ignore_case = match_ignore_case = 0;-
372 print_shift_error = 0;-
373 source_uses_path = promptvars = 1;-
374-
375-
376 check_jobs_at_exit = 0;-
377-
378-
379-
380 extended_glob = 0;-
381-
382-
383-
384 literal_history = 0;-
385 force_append_history = 0;-
386 command_oriented_history = 1;-
387-
388-
389-
390 complete_fullquote = 1;-
391 force_fignore = 1;-
392 hist_verify = history_reediting = 0;-
393 perform_hostname_completion = 1;-
394-
395-
396-
397 dircomplete_expand = 0;-
398-
399 dircomplete_spelling = 0;-
400 no_empty_command_completion = 0;-
401-
402-
403-
404 prog_completion_enabled = 1;-
405-
406-
407-
408-
409-
410 xpg_echo = 0;-
411-
412-
413 shopt_login_shell = login_shell;-
414}
executed 15 times by 1 test: end of block
Executed by:
  • Self test
15
415-
416static int-
417find_shopt (name)-
418 char *name;-
419{-
420 int i;-
421-
422 for (i = 0; shopt_vars[i].name
shopt_vars[i].nameDescription
TRUEevaluated 8414 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test
; i++)
15-8414
423 if (((
(name)[0] == (...rs[i].name)[0]Description
TRUEevaluated 521 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7893 times by 1 test
Evaluated by:
  • Self test
name)[0] == (shopt_vars[i].name)[0]
(name)[0] == (...rs[i].name)[0]Description
TRUEevaluated 521 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7893 times by 1 test
Evaluated by:
  • Self test
&&
521-7893
424 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
425 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
426 ) && __builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
427 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
428 ) && (__s1_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
429 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
430 ), __s2_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
431 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
432 ), (!((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
433 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
434 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
435 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
436 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
437 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
438 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
439 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
440 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
441 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
442 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
443 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
444 ) : (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
445 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
446 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
447 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
448 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
449 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
450 ) == 1) && (__s1_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
451 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
452 ), __s1_len < 4) ? (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
453 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
454 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
455 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
456 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
457 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
458 ) == 1) ? __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
459 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
460 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
461 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
462 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
463 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
464 ); int __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
465 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
466 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
467 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
468 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
469 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
470 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
471 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]);
0-291
472 ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
473 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
474 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
475 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
476 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
477 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
478 ) == 1) && (__s2_len = __builtin_strlen (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
479 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
480 ), __s2_len < 4) ? (__builtin_constant_p (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
481 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
482 ) && ((size_t)(const void *)((
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
483 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
484 ) + 1) - (size_t)(const void *)(
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
485 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
486 ) == 1) ? __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
487 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
488 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
489 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
490 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
491 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
492 ); int __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
493 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
494 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
495 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
496 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
497 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
498 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( shopt_vars[i].name ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
499 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( shopt_vars[i].name ))[3] - __s2[3]);
0-291
500 ))[3] - __s2[3]);
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
never executed: __result = (((const unsigned char *) (const char *) ( shopt_vars[i].name ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : __builtin_strcmp (
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
0-291
501 name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
502 ,
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
503 shopt_vars[i].name
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
504 )))); })
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
230-291
505 == 0
__extension__ ... )))); }) == 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 291 times by 1 test
Evaluated by:
  • Self test
))
230-291
506 return
executed 230 times by 1 test: return i;
Executed by:
  • Self test
i;
executed 230 times by 1 test: return i;
Executed by:
  • Self test
230
507 return
executed 15 times by 1 test: return -1;
Executed by:
  • Self test
-1;
executed 15 times by 1 test: return -1;
Executed by:
  • Self test
15
508}-
509-
510static void-
511shopt_error (s)-
512 char *s;-
513{-
514 builtin_error (-
515 dcgettext (((void *)0), -
516 "%s: invalid shell option name"-
517 , 5)-
518 , s);-
519}
executed 15 times by 1 test: end of block
Executed by:
  • Self test
15
520-
521static int-
522toggle_shopts (mode, list, quiet)-
523 int mode;-
524 WORD_LIST *list;-
525 int quiet;-
526{-
527 WORD_LIST *l;-
528 int ind, rval;-
529 SHELL_VAR *v;-
530-
531 for (l = list, rval = 0; l
lDescription
TRUEevaluated 228 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 224 times by 1 test
Evaluated by:
  • Self test
; l = l->next)
224-228
532 {-
533 ind = find_shopt (l->word->word);-
534 if (ind < 0
ind < 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 223 times by 1 test
Evaluated by:
  • Self test
)
5-223
535 {-
536 shopt_error (l->word->word);-
537 rval = 1;-
538 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test
5
539 else-
540 {-
541 *shopt_vars[ind].value = mode;-
542 if (shopt_vars[ind].set_func
shopt_vars[ind].set_funcDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 198 times by 1 test
Evaluated by:
  • Self test
)
25-198
543 (*
executed 25 times by 1 test: (*shopt_vars[ind].set_func) (shopt_vars[ind].name, mode);
Executed by:
  • Self test
shopt_vars[ind].set_func) (shopt_vars[ind].name, mode);
executed 25 times by 1 test: (*shopt_vars[ind].set_func) (shopt_vars[ind].name, mode);
Executed by:
  • Self test
25
544 }
executed 223 times by 1 test: end of block
Executed by:
  • Self test
223
545 }-
546-
547-
548 if (v = find_variable ("BASHOPTS")
v = find_variable ("BASHOPTS")Description
TRUEevaluated 224 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-224
549 set_bashopts ();
executed 224 times by 1 test: set_bashopts ();
Executed by:
  • Self test
224
550 return
executed 224 times by 1 test: return (rval);
Executed by:
  • Self test
(rval);
executed 224 times by 1 test: return (rval);
Executed by:
  • Self test
224
551}-
552-
553static void-
554print_shopt (name, val, flags)-
555 char *name;-
556 int val, flags;-
557{-
558 if (flags & 0x10
flags & 0x10Description
TRUEevaluated 105 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test
)
41-105
559 printf ("shopt %s %s\n", val ? "-s" : "-u", name);
executed 105 times by 1 test: printf ("shopt %s %s\n", val ? "-s" : "-u", name);
Executed by:
  • Self test
105
560 else-
561 printf ("%-15s\t%s\n", name, val ? on : off);
executed 41 times by 1 test: printf ("%-15s\t%s\n", name, val ? on : off);
Executed by:
  • Self test
41
562}-
563-
564-
565-
566static int-
567list_shopts (list, flags)-
568 WORD_LIST *list;-
569 int flags;-
570{-
571 WORD_LIST *l;-
572 int i, val, rval;-
573-
574 if (list == 0
list == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
)
1-14
575 {-
576 for (i = 0; shopt_vars[i].name
shopt_vars[i].nameDescription
TRUEevaluated 51 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
; i++)
1-51
577 {-
578 val = *shopt_vars[i].value;-
579 if ((
(flags & 0x04) == 0Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x04) == 0
(flags & 0x04) == 0Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-51
580 print_shopt (shopt_vars[i].name, val, flags);
executed 51 times by 1 test: print_shopt (shopt_vars[i].name, val, flags);
Executed by:
  • Self test
51
581 }
executed 51 times by 1 test: end of block
Executed by:
  • Self test
51
582 return
executed 1 time by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
(sh_chkwrite (0));
executed 1 time by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
1
583 }-
584-
585 for (l = list, rval = 0; l
lDescription
TRUEevaluated 17 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test
; l = l->next)
14-17
586 {-
587 i = find_shopt (l->word->word);-
588 if (i < 0
i < 0Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test
)
7-10
589 {-
590 shopt_error (l->word->word);-
591 rval = 1;-
592 continue;
executed 10 times by 1 test: continue;
Executed by:
  • Self test
10
593 }-
594 val = *shopt_vars[i].value;-
595 if (val == 0
val == 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
)
2-5
596 rval = 1;
executed 5 times by 1 test: rval = 1;
Executed by:
  • Self test
5
597 if ((
(flags & 0x04) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
flags & 0x04) == 0
(flags & 0x04) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
3-4
598 print_shopt (l->word->word, val, flags);
executed 4 times by 1 test: print_shopt (l->word->word, val, flags);
Executed by:
  • Self test
4
599 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test
7
600-
601 return
executed 14 times by 1 test: return (sh_chkwrite (rval));
Executed by:
  • Self test
(sh_chkwrite (rval));
executed 14 times by 1 test: return (sh_chkwrite (rval));
Executed by:
  • Self test
14
602}-
603-
604static int-
605list_some_shopts (mode, flags)-
606 int mode, flags;-
607{-
608 int val, i;-
609-
610 for (i = 0; shopt_vars[i].name
shopt_vars[i].nameDescription
TRUEevaluated 153 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
; i++)
3-153
611 {-
612 val = *shopt_vars[i].value;-
613 if (((
((flags & 0x04) == 0)Description
TRUEevaluated 153 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x04) == 0)
((flags & 0x04) == 0)Description
TRUEevaluated 153 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&& mode == val
mode == valDescription
TRUEevaluated 91 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 62 times by 1 test
Evaluated by:
  • Self test
)
0-153
614 print_shopt (shopt_vars[i].name, val, flags);
executed 91 times by 1 test: print_shopt (shopt_vars[i].name, val, flags);
Executed by:
  • Self test
91
615 }
executed 153 times by 1 test: end of block
Executed by:
  • Self test
153
616 return
executed 3 times by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
(sh_chkwrite (0));
executed 3 times by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
3
617}-
618-
619static int-
620list_shopt_o_options (list, flags)-
621 WORD_LIST *list;-
622 int flags;-
623{-
624 WORD_LIST *l;-
625 int val, rval;-
626-
627 if (list == 0
list == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
)
1-6
628 {-
629 if ((
(flags & 0x04) == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x04) == 0
(flags & 0x04) == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-1
630 list_minus_o_opts (-1, (flags & 0x10));
executed 1 time by 1 test: list_minus_o_opts (-1, (flags & 0x10));
Executed by:
  • Self test
1
631 return
executed 1 time by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
(sh_chkwrite (0));
executed 1 time by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
1
632 }-
633-
634 for (l = list, rval = 0; l
lDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test
; l = l->next)
6
635 {-
636 val = minus_o_option_value (l->word->word);-
637 if (val == -1
val == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test
)
1-5
638 {-
639 sh_invalidoptname (l->word->word);-
640 rval = 1;-
641 continue;
executed 1 time by 1 test: continue;
Executed by:
  • Self test
1
642 }-
643 if (val == 0
val == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
)
1-4
644 rval = 1;
executed 4 times by 1 test: rval = 1;
Executed by:
  • Self test
4
645 if ((
(flags & 0x04) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
flags & 0x04) == 0
(flags & 0x04) == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
2-3
646 {-
647 if (flags & 0x10
flags & 0x10Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-2
648 printf ("set %co %s\n", val ? '-' : '+', l->word->word);
executed 2 times by 1 test: printf ("set %co %s\n", val ? '-' : '+', l->word->word);
Executed by:
  • Self test
2
649 else-
650 printf ("%-15s\t%s\n", l->word->word, val ? on : off);
never executed: printf ("%-15s\t%s\n", l->word->word, val ? on : off);
0
651 }-
652 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test
5
653 return
executed 6 times by 1 test: return (sh_chkwrite (rval));
Executed by:
  • Self test
(sh_chkwrite (rval));
executed 6 times by 1 test: return (sh_chkwrite (rval));
Executed by:
  • Self test
6
654}-
655-
656static int-
657list_some_o_options (mode, flags)-
658 int mode, flags;-
659{-
660 if ((
(flags & 0x04) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
flags & 0x04) == 0
(flags & 0x04) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-3
661 list_minus_o_opts (mode, (flags & 0x10));
executed 3 times by 1 test: list_minus_o_opts (mode, (flags & 0x10));
Executed by:
  • Self test
3
662 return
executed 3 times by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
(sh_chkwrite (0));
executed 3 times by 1 test: return (sh_chkwrite (0));
Executed by:
  • Self test
3
663}-
664-
665static int-
666set_shopt_o_options (mode, list, quiet)-
667 int mode;-
668 WORD_LIST *list;-
669 int quiet;-
670{-
671 WORD_LIST *l;-
672 int rval;-
673-
674 for (l = list, rval = 0; l
lDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
; l = l->next)
3
675 {-
676 if (set_minus_o_option (mode, l->word->word) == 1
set_minus_o_op...rd->word) == 1Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
0-3
677 rval = 1;
never executed: rval = 1;
0
678 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test
3
679 set_shellopts ();-
680 return
executed 3 times by 1 test: return rval;
Executed by:
  • Self test
rval;
executed 3 times by 1 test: return rval;
Executed by:
  • Self test
3
681}-
682-
683-
684-
685static int-
686set_shellopts_after_change (option_name, mode)-
687 char *option_name;-
688 int mode;-
689{-
690 set_shellopts ();-
691 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
692}-
693-
694static int-
695shopt_set_debug_mode (option_name, mode)-
696 char *option_name;-
697 int mode;-
698{-
699-
700 error_trace_mode = function_trace_mode = debugging_mode;-
701 set_shellopts ();-
702 if (debugging_mode
debugging_modeDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-21
703 init_bash_argv ();
executed 21 times by 1 test: init_bash_argv ();
Executed by:
  • Self test
21
704-
705 return
executed 21 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 21 times by 1 test: return (0);
Executed by:
  • Self test
21
706}-
707-
708-
709static int-
710shopt_enable_hostname_completion (option_name, mode)-
711 char *option_name;-
712 int mode;-
713{-
714 return
executed 3 times by 1 test: return (enable_hostname_completion (mode));
Executed by:
  • Self test
(enable_hostname_completion (mode));
executed 3 times by 1 test: return (enable_hostname_completion (mode));
Executed by:
  • Self test
3
715}-
716-
717-
718static int-
719set_compatibility_level (option_name, mode)-
720 char *option_name;-
721 int mode;-
722{-
723 int ind;-
724 char *rhs;-
725-
726-
727-
728-
729 if (mode
modeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
730 {-
731 shopt_compat31 = shopt_compat32 = 0;-
732 shopt_compat40 = shopt_compat41 = shopt_compat42 = shopt_compat43 = 0;-
733 shopt_compat44 = 0;-
734 ind = find_shopt (option_name);-
735 *shopt_vars[ind].value = mode;-
736 }
never executed: end of block
0
737-
738-
739 if (shopt_compat31
shopt_compat31Description
TRUEnever evaluated
FALSEnever evaluated
)
0
740 shell_compatibility_level = 31;
never executed: shell_compatibility_level = 31;
0
741 else if (shopt_compat32
shopt_compat32Description
TRUEnever evaluated
FALSEnever evaluated
)
0
742 shell_compatibility_level = 32;
never executed: shell_compatibility_level = 32;
0
743 else if (shopt_compat40
shopt_compat40Description
TRUEnever evaluated
FALSEnever evaluated
)
0
744 shell_compatibility_level = 40;
never executed: shell_compatibility_level = 40;
0
745 else if (shopt_compat41
shopt_compat41Description
TRUEnever evaluated
FALSEnever evaluated
)
0
746 shell_compatibility_level = 41;
never executed: shell_compatibility_level = 41;
0
747 else if (shopt_compat42
shopt_compat42Description
TRUEnever evaluated
FALSEnever evaluated
)
0
748 shell_compatibility_level = 42;
never executed: shell_compatibility_level = 42;
0
749 else if (shopt_compat43
shopt_compat43Description
TRUEnever evaluated
FALSEnever evaluated
)
0
750 shell_compatibility_level = 43;
never executed: shell_compatibility_level = 43;
0
751 else if (shopt_compat44
shopt_compat44Description
TRUEnever evaluated
FALSEnever evaluated
)
0
752 shell_compatibility_level = 44;
never executed: shell_compatibility_level = 44;
0
753 else-
754 shell_compatibility_level = 50;
never executed: shell_compatibility_level = 50;
0
755-
756-
757 rhs = itos (shell_compatibility_level);-
758 bind_variable ("BASH_COMPAT", rhs, 0);-
759 sh_xfree((rhs), "./shopt.def", 644);-
760-
761 return
never executed: return 0;
0;
never executed: return 0;
0
762}-
763-
764-
765-
766void-
767set_compatibility_opts ()-
768{-
769 shopt_compat31 = shopt_compat32 = 0;-
770 shopt_compat40 = shopt_compat41 = shopt_compat42 = shopt_compat43 = 0;-
771 shopt_compat44 = 0;-
772 switch (shell_compatibility_level)-
773 {-
774 case
executed 5447 times by 1 test: case 50:
Executed by:
  • Self test
50:
executed 5447 times by 1 test: case 50:
Executed by:
  • Self test
5447
775 break;
executed 5447 times by 1 test: break;
Executed by:
  • Self test
5447
776 case
never executed: case 44:
44:
never executed: case 44:
0
777 shopt_compat44 = 1; break;
never executed: break;
0
778 case
never executed: case 43:
43:
never executed: case 43:
0
779 shopt_compat43 = 1; break;
never executed: break;
0
780 case
never executed: case 42:
42:
never executed: case 42:
0
781 shopt_compat42 = 1; break;
never executed: break;
0
782 case
never executed: case 41:
41:
never executed: case 41:
0
783 shopt_compat41 = 1; break;
never executed: break;
0
784 case
never executed: case 40:
40:
never executed: case 40:
0
785 shopt_compat40 = 1; break;
never executed: break;
0
786 case
never executed: case 32:
32:
never executed: case 32:
0
787 shopt_compat32 = 1; break;
never executed: break;
0
788 case
never executed: case 31:
31:
never executed: case 31:
0
789 shopt_compat31 = 1; break;
never executed: break;
0
790 }-
791}
executed 5447 times by 1 test: end of block
Executed by:
  • Self test
5447
792-
793-
794static int-
795shopt_set_complete_direxpand (option_name, mode)-
796 char *option_name;-
797 int mode;-
798{-
799 set_directory_hook ();-
800 return
never executed: return 0;
0;
never executed: return 0;
0
801}-
802-
803-
804-
805-
806-
807static int-
808set_restricted_shell (option_name, mode)-
809 char *option_name;-
810 int mode;-
811{-
812 static int save_restricted = -1;-
813-
814 if (save_restricted == -1
save_restricted == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
815 save_restricted = shell_is_restricted (shell_name);
never executed: save_restricted = shell_is_restricted (shell_name);
0
816-
817 restricted_shell = save_restricted;-
818 return
never executed: return (0);
(0);
never executed: return (0);
0
819}-
820-
821-
822-
823int-
824set_login_shell (option_name, mode)-
825 char *option_name;-
826 int mode;-
827{-
828 shopt_login_shell = login_shell != 0;-
829 return
executed 5447 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 5447 times by 1 test: return (0);
Executed by:
  • Self test
5447
830}-
831-
832char **-
833get_shopt_options ()-
834{-
835 char **ret;-
836 int n, i;-
837-
838 n = sizeof (shopt_vars) / sizeof (shopt_vars[0]);-
839 ret = strvec_create (n + 1);-
840 for (i = 0; shopt_vars[i].name
shopt_vars[i].nameDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
841 ret[i] = (char *)strcpy (sh_xmalloc((1 + strlen (shopt_vars[i].name)), "./shopt.def", 726), (shopt_vars[i].name));
never executed: ret[i] = (char *)strcpy (sh_xmalloc((1 + strlen (shopt_vars[i].name)), "./shopt.def", 726), (shopt_vars[i].name));
0
842 ret[i] = (char *)-
843 ((void *)0)-
844 ;-
845 return
never executed: return ret;
ret;
never executed: return ret;
0
846}-
847-
848-
849-
850-
851-
852-
853int-
854shopt_setopt (name, mode)-
855 char *name;-
856 int mode;-
857{-
858 WORD_LIST *wl;-
859 int r;-
860-
861 wl = make_word_list (make_word(name), ((WORD_LIST *)-
862 ((void *)0)-
863 ));-
864 r = toggle_shopts (mode, wl, 0);-
865 dispose_words (wl);-
866 return
never executed: return r;
r;
never executed: return r;
0
867}-
868-
869int-
870shopt_listopt (name, reusable)-
871 char *name;-
872 int reusable;-
873{-
874 int i;-
875-
876 if (name == 0
name == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
877 return
never executed: return (list_shopts ((WORD_LIST *) ((void *)0) , reusable ? 0x10 : 0));
(list_shopts ((WORD_LIST *)
never executed: return (list_shopts ((WORD_LIST *) ((void *)0) , reusable ? 0x10 : 0));
0
878 ((void *)0)
never executed: return (list_shopts ((WORD_LIST *) ((void *)0) , reusable ? 0x10 : 0));
0
879 , reusable ? 0x10 : 0));
never executed: return (list_shopts ((WORD_LIST *) ((void *)0) , reusable ? 0x10 : 0));
0
880-
881 i = find_shopt (name);-
882 if (i < 0
i < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
883 {-
884 shopt_error (name);-
885 return
never executed: return (1);
(1);
never executed: return (1);
0
886 }-
887-
888 print_shopt (name, *shopt_vars[i].value, reusable ? 0x10 : 0);-
889 return
never executed: return (sh_chkwrite (0));
(sh_chkwrite (0));
never executed: return (sh_chkwrite (0));
0
890}-
891-
892void-
893set_bashopts ()-
894{-
895 char *value;-
896 char tflag[(sizeof (shopt_vars) / sizeof (shopt_vars[0]))];-
897 int vsize, i, vptr, *ip, exported;-
898 SHELL_VAR *v;-
899-
900 for (vsize = i = 0; shopt_vars[i].name
shopt_vars[i].nameDescription
TRUEevaluated 289221 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5671 times by 1 test
Evaluated by:
  • Self test
; i++)
5671-289221
901 {-
902 tflag[i] = 0;-
903 if ((*
(*shopt_vars[i].value)Description
TRUEevaluated 51361 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 237860 times by 1 test
Evaluated by:
  • Self test
shopt_vars[i].value)
(*shopt_vars[i].value)Description
TRUEevaluated 51361 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 237860 times by 1 test
Evaluated by:
  • Self test
)
51361-237860
904 {-
905 vsize += strlen (shopt_vars[i].name) + 1;-
906 tflag[i] = 1;-
907 }
executed 51361 times by 1 test: end of block
Executed by:
  • Self test
51361
908 }
executed 289221 times by 1 test: end of block
Executed by:
  • Self test
289221
909-
910 value = (char *)sh_xmalloc((vsize + 1), "./shopt.def", 789);-
911-
912 for (i = vptr = 0; shopt_vars[i].name
shopt_vars[i].nameDescription
TRUEevaluated 289221 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5671 times by 1 test
Evaluated by:
  • Self test
; i++)
5671-289221
913 {-
914 if (tflag[i]
tflag[i]Description
TRUEevaluated 51361 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 237860 times by 1 test
Evaluated by:
  • Self test
)
51361-237860
915 {-
916 strcpy (value + vptr, shopt_vars[i].name);-
917 vptr += strlen (shopt_vars[i].name);-
918 value[vptr++] = ':';-
919 }
executed 51361 times by 1 test: end of block
Executed by:
  • Self test
51361
920 }
executed 289221 times by 1 test: end of block
Executed by:
  • Self test
289221
921-
922 if (vptr
vptrDescription
TRUEevaluated 5671 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-5671
923 vptr--;
executed 5671 times by 1 test: vptr--;
Executed by:
  • Self test
5671
924 value[vptr] = '\0';-
925-
926 v = find_variable ("BASHOPTS");-
927-
928-
929-
930 if (v
vDescription
TRUEevaluated 224 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 5447 times by 1 test
Evaluated by:
  • Self test
)
224-5447
931 {-
932 ((v)->attributes &= ~(0x0000002));-
933 exported = ((((v)->attributes) & (0x0000001)));-
934 }
executed 224 times by 1 test: end of block
Executed by:
  • Self test
224
935 else-
936 exported = 0;
executed 5447 times by 1 test: exported = 0;
Executed by:
  • Self test
5447
937-
938 v = bind_variable ("BASHOPTS", value, 0);-
939-
940-
941-
942-
943 ((v)->attributes |= (0x0000002));-
944 if (mark_modified_vars
mark_modified_varsDescription
TRUEnever evaluated
FALSEevaluated 5671 times by 1 test
Evaluated by:
  • Self test
&& exported == 0
exported == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& ((((
((((v)->attrib... (0x0000001)))Description
TRUEnever evaluated
FALSEnever evaluated
v)->attributes) & (0x0000001)))
((((v)->attrib... (0x0000001)))Description
TRUEnever evaluated
FALSEnever evaluated
)
0-5671
945 ((
never executed: ((v)->attributes &= ~(0x0000001));
v)->attributes &= ~(0x0000001));
never executed: ((v)->attributes &= ~(0x0000001));
0
946-
947 sh_xfree((value), "./shopt.def", 826);-
948}
executed 5671 times by 1 test: end of block
Executed by:
  • Self test
5671
949-
950void-
951parse_bashopts (value)-
952 char *value;-
953{-
954 char *vname;-
955 int vptr, ind;-
956-
957 vptr = 0;-
958 while (vname = extract_colon_unit (value, &vptr)
vname = extrac...(value, &vptr)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
959 {-
960 ind = find_shopt (vname);-
961 if (ind >= 0
ind >= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
962 {-
963 *shopt_vars[ind].value = 1;-
964 if (shopt_vars[ind].set_func
shopt_vars[ind].set_funcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
965 (*
never executed: (*shopt_vars[ind].set_func) (shopt_vars[ind].name, 1);
shopt_vars[ind].set_func) (shopt_vars[ind].name, 1);
never executed: (*shopt_vars[ind].set_func) (shopt_vars[ind].name, 1);
0
966 }
never executed: end of block
0
967 sh_xfree((vname), "./shopt.def", 846);-
968 }
never executed: end of block
0
969}
never executed: end of block
0
970-
971void-
972initialize_bashopts (no_bashopts)-
973 int no_bashopts;-
974{-
975 char *temp;-
976 SHELL_VAR *var;-
977-
978 if (no_bashopts == 0
no_bashopts == 0Description
TRUEevaluated 5447 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-5447
979 {-
980 var = find_variable ("BASHOPTS");-
981-
982 if (var
varDescription
TRUEnever evaluated
FALSEevaluated 5447 times by 1 test
Evaluated by:
  • Self test
&& ((((
((((var)->attr... (0x0008000)))Description
TRUEnever evaluated
FALSEnever evaluated
var)->attributes) & (0x0008000)))
((((var)->attr... (0x0008000)))Description
TRUEnever evaluated
FALSEnever evaluated
)
0-5447
983 {-
984 temp = (((((
((((var)->attr... (0x0000004)))Description
TRUEnever evaluated
FALSEnever evaluated
var)->attributes) & (0x0000004)))
((((var)->attr... (0x0000004)))Description
TRUEnever evaluated
FALSEnever evaluated
|| ((((
((((var)->attr... (0x0000040)))Description
TRUEnever evaluated
FALSEnever evaluated
var)->attributes) & (0x0000040)))
((((var)->attr... (0x0000040)))Description
TRUEnever evaluated
FALSEnever evaluated
) ? (char *)
0
985 ((void *)0) -
986 : (char *)strcpy (sh_xmalloc((1 + strlen (((var)->value))), "./shopt.def", 863), (((var)->value)));-
987 if (temp
tempDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
988 {-
989 parse_bashopts (temp);-
990 sh_xfree((temp), "./shopt.def", 867);-
991 }
never executed: end of block
0
992 }
never executed: end of block
0
993 }
executed 5447 times by 1 test: end of block
Executed by:
  • Self test
5447
994-
995-
996 set_bashopts ();-
997}
executed 5447 times by 1 test: end of block
Executed by:
  • Self test
5447
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2