| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/command.def |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | - | |||||||||||||
| 15 | - | |||||||||||||
| 16 | - | |||||||||||||
| 17 | int | - | ||||||||||||
| 18 | command_builtin (list) | - | ||||||||||||
| 19 | WORD_LIST *list; | - | ||||||||||||
| 20 | { | - | ||||||||||||
| 21 | int result, verbose, use_standard_path, opt; | - | ||||||||||||
| 22 | COMMAND *command; | - | ||||||||||||
| 23 | - | |||||||||||||
| 24 | verbose = use_standard_path = 0; | - | ||||||||||||
| 25 | reset_internal_getopt (); | - | ||||||||||||
| 26 | while ((
| 70-111 | ||||||||||||
| 27 | { | - | ||||||||||||
| 28 | switch (opt) | - | ||||||||||||
| 29 | { | - | ||||||||||||
| 30 | case executed 35 times by 1 test: 'p':case 'p':Executed by:
executed 35 times by 1 test: case 'p':Executed by:
| 35 | ||||||||||||
| 31 | use_standard_path = 0x100; | - | ||||||||||||
| 32 | break; executed 35 times by 1 test: break;Executed by:
| 35 | ||||||||||||
| 33 | case executed 10 times by 1 test: 'V':case 'V':Executed by:
executed 10 times by 1 test: case 'V':Executed by:
| 10 | ||||||||||||
| 34 | verbose = 0x002|0x080; | - | ||||||||||||
| 35 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||
| 36 | case executed 24 times by 1 test: 'v':case 'v':Executed by:
executed 24 times by 1 test: case 'v':Executed by:
| 24 | ||||||||||||
| 37 | verbose = 0x004; | - | ||||||||||||
| 38 | break; executed 24 times by 1 test: break;Executed by:
| 24 | ||||||||||||
| 39 | case never executed: -99:case -99:never executed: builtin_help (); returncase -99:never executed: (258);return (258);never executed: return (258); | 0 | ||||||||||||
| 40 | default executed 1 time by 1 test: :default:Executed by:
executed 1 time by 1 test: default:Executed by:
| 1 | ||||||||||||
| 41 | builtin_usage (); | - | ||||||||||||
| 42 | return executed 1 time by 1 test: (258);return (258);Executed by:
executed 1 time by 1 test: return (258);Executed by:
| 1 | ||||||||||||
| 43 | } | - | ||||||||||||
| 44 | } | - | ||||||||||||
| 45 | list = loptend; | - | ||||||||||||
| 46 | - | |||||||||||||
| 47 | if (list == 0
| 9-102 | ||||||||||||
| 48 | return executed 9 times by 1 test: (0);return (0);Executed by:
executed 9 times by 1 test: return (0);Executed by:
| 9 | ||||||||||||
| 49 | - | |||||||||||||
| 50 | - | |||||||||||||
| 51 | if (use_standard_path
| 1-67 | ||||||||||||
| 52 | { | - | ||||||||||||
| 53 | sh_restricted ("-p"); | - | ||||||||||||
| 54 | return executed 1 time by 1 test: (1);return (1);Executed by:
executed 1 time by 1 test: return (1);Executed by:
| 1 | ||||||||||||
| 55 | } | - | ||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | if (verbose
| 34-67 | ||||||||||||
| 59 | { | - | ||||||||||||
| 60 | int found, any_found; | - | ||||||||||||
| 61 | - | |||||||||||||
| 62 | for (any_found = 0; list
| 34 | ||||||||||||
| 63 | { | - | ||||||||||||
| 64 | found = describe_command (list->word->word, verbose|use_standard_path); | - | ||||||||||||
| 65 | - | |||||||||||||
| 66 | if (found == 0
| 0-26 | ||||||||||||
| 67 | sh_notfound (list->word->word); never executed: sh_notfound (list->word->word); | 0 | ||||||||||||
| 68 | - | |||||||||||||
| 69 | any_found += found; | - | ||||||||||||
| 70 | } executed 34 times by 1 test: end of blockExecuted by:
| 34 | ||||||||||||
| 71 | - | |||||||||||||
| 72 | return executed 34 times by 1 test: (any_found ? 0 : 1);return (any_found ? 0 : 1);Executed by:
executed 34 times by 1 test: return (any_found ? 0 : 1);Executed by:
| 34 | ||||||||||||
| 73 | } | - | ||||||||||||
| 74 | - | |||||||||||||
| 75 | begin_unwind_frame ("command_builtin"); | - | ||||||||||||
| 76 | - | |||||||||||||
| 77 | - | |||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | - | |||||||||||||
| 81 | command = make_bare_simple_command (); | - | ||||||||||||
| 82 | command->value.Simple->words = (WORD_LIST *)copy_word_list (list); | - | ||||||||||||
| 83 | command->value.Simple->redirects = (REDIRECT *) | - | ||||||||||||
| 84 | ((void *)0) | - | ||||||||||||
| 85 | ; | - | ||||||||||||
| 86 | command->flags |= (0x10 | 0x20 | 0x0800 | (use_standard_path ? 0x4000 : 0)); | - | ||||||||||||
| 87 | command->value.Simple->flags |= (0x10 | 0x20 | 0x0800 | (use_standard_path ? 0x4000 : 0)); | - | ||||||||||||
| 88 | - | |||||||||||||
| 89 | add_unwind_protect ((char *)dispose_command, command); | - | ||||||||||||
| 90 | result = execute_command (command); | - | ||||||||||||
| 91 | - | |||||||||||||
| 92 | run_unwind_frame ("command_builtin"); | - | ||||||||||||
| 93 | - | |||||||||||||
| 94 | return executed 64 times by 1 test: (result);return (result);Executed by:
executed 64 times by 1 test: return (result);Executed by:
| 64 | ||||||||||||
| 95 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |