| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/eval.c |
| 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 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | extern sigset_t top_level_mask; | - | ||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | static void send_pwd_to_eterm (void); | - | ||||||||||||||||||||||||
| 23 | static void alrm_catcher (int); | - | ||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | int | - | ||||||||||||||||||||||||
| 28 | reader_loop () | - | ||||||||||||||||||||||||
| 29 | { | - | ||||||||||||||||||||||||
| 30 | int our_indirection_level; | - | ||||||||||||||||||||||||
| 31 | COMMAND * volatile current_command; | - | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | ((void) &(current_command)); | - | ||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||
| 35 | current_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 36 | ((void *)0) | - | ||||||||||||||||||||||||
| 37 | ; | - | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | our_indirection_level = ++indirection_level; | - | ||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | while (EOF_Reached == 0
| 399-176017 | ||||||||||||||||||||||||
| 42 | { | - | ||||||||||||||||||||||||
| 43 | int code; | - | ||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||
| 45 | code = | - | ||||||||||||||||||||||||
| 46 | __sigsetjmp ( | - | ||||||||||||||||||||||||
| 47 | (top_level) | - | ||||||||||||||||||||||||
| 48 | , | - | ||||||||||||||||||||||||
| 49 | 0 | - | ||||||||||||||||||||||||
| 50 | ) | - | ||||||||||||||||||||||||
| 51 | ; | - | ||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||
| 54 | unlink_fifo_list (); | - | ||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | if (interactive_shell
| 0-176466 | ||||||||||||||||||||||||
| 60 | 2
| 0-2 | ||||||||||||||||||||||||
| 61 | ) == 0
| 0-2 | ||||||||||||||||||||||||
| 62 | 2
| 0-2 | ||||||||||||||||||||||||
| 63 | ) == 0
| 0-2 | ||||||||||||||||||||||||
| 64 | set_signal_handler ( executed 2 times by 1 test: set_signal_handler ( 2 , sigint_sighandler);Executed by:
| 2 | ||||||||||||||||||||||||
| 65 | 2 executed 2 times by 1 test: set_signal_handler ( 2 , sigint_sighandler);Executed by:
| 2 | ||||||||||||||||||||||||
| 66 | , sigint_sighandler); executed 2 times by 1 test: set_signal_handler ( 2 , sigint_sighandler);Executed by:
| 2 | ||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||
| 68 | if (code != 0
| 451-176017 | ||||||||||||||||||||||||
| 69 | { | - | ||||||||||||||||||||||||
| 70 | indirection_level = our_indirection_level; | - | ||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | switch (code) | - | ||||||||||||||||||||||||
| 73 | { | - | ||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | case executed 2 times by 1 test: 1:case 1:Executed by:
executed 2 times by 1 test: case 1:Executed by:
| 2 | ||||||||||||||||||||||||
| 76 | case executed 9 times by 1 test: 4:case 4:Executed by:
executed 9 times by 1 test: case 4:Executed by:
| 9 | ||||||||||||||||||||||||
| 77 | case executed 52 times by 1 test: 3:case 3:Executed by:
executed 52 times by 1 test: case 3:Executed by:
| 52 | ||||||||||||||||||||||||
| 78 | current_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 79 | ((void *)0) | - | ||||||||||||||||||||||||
| 80 | ; | - | ||||||||||||||||||||||||
| 81 | if (exit_immediately_on_error
| 7-56 | ||||||||||||||||||||||||
| 82 | variable_context = 0; executed 7 times by 1 test: variable_context = 0;Executed by:
| 7 | ||||||||||||||||||||||||
| 83 | EOF_Reached = | - | ||||||||||||||||||||||||
| 84 | (-1) | - | ||||||||||||||||||||||||
| 85 | ; | - | ||||||||||||||||||||||||
| 86 | goto executed 63 times by 1 test: exec_done;goto exec_done;Executed by:
executed 63 times by 1 test: goto exec_done;Executed by:
| 63 | ||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | case executed 388 times by 1 test: 2:case 2:Executed by:
executed 388 times by 1 test: case 2:Executed by:
| 388 | ||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | - | |||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | if (last_command_exit_value == 0
| 17-371 | ||||||||||||||||||||||||
| 93 | last_command_exit_value = 1; executed 17 times by 1 test: last_command_exit_value = 1;Executed by:
| 17 | ||||||||||||||||||||||||
| 94 | if (subshell_environment
| 0-388 | ||||||||||||||||||||||||
| 95 | { | - | ||||||||||||||||||||||||
| 96 | current_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 97 | ((void *)0) | - | ||||||||||||||||||||||||
| 98 | ; | - | ||||||||||||||||||||||||
| 99 | EOF_Reached = | - | ||||||||||||||||||||||||
| 100 | (-1) | - | ||||||||||||||||||||||||
| 101 | ; | - | ||||||||||||||||||||||||
| 102 | goto never executed: exec_done;goto exec_done;never executed: goto exec_done; | 0 | ||||||||||||||||||||||||
| 103 | } | - | ||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | if (current_command
| 17-371 | ||||||||||||||||||||||||
| 106 | { | - | ||||||||||||||||||||||||
| 107 | dispose_command (current_command); | - | ||||||||||||||||||||||||
| 108 | current_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 109 | ((void *)0) | - | ||||||||||||||||||||||||
| 110 | ; | - | ||||||||||||||||||||||||
| 111 | } executed 371 times by 1 test: end of blockExecuted by:
| 371 | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | sigprocmask ( | - | ||||||||||||||||||||||||
| 114 | 2 | - | ||||||||||||||||||||||||
| 115 | , &top_level_mask, (sigset_t *) | - | ||||||||||||||||||||||||
| 116 | ((void *)0) | - | ||||||||||||||||||||||||
| 117 | ); | - | ||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||
| 119 | break; executed 388 times by 1 test: break;Executed by:
| 388 | ||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 122 | command_error ("reader_loop", 3, code, 0); | - | ||||||||||||||||||||||||
| 123 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 124 | } | - | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | executing = 0; | - | ||||||||||||||||||||||||
| 127 | if (temporary_env
| 0-176405 | ||||||||||||||||||||||||
| 128 | dispose_used_env_vars (); never executed: dispose_used_env_vars (); | 0 | ||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||
| 135 | if (read_command () == 0
| 6-176381 | ||||||||||||||||||||||||
| 136 | { | - | ||||||||||||||||||||||||
| 137 | if (interactive_shell == 0
| 2-176379 | ||||||||||||||||||||||||
| 138 | { | - | ||||||||||||||||||||||||
| 139 | last_command_exit_value = 0; | - | ||||||||||||||||||||||||
| 140 | dispose_command (global_command); | - | ||||||||||||||||||||||||
| 141 | global_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 142 | ((void *)0) | - | ||||||||||||||||||||||||
| 143 | ; | - | ||||||||||||||||||||||||
| 144 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 145 | else if (current_command = global_command
| 79966-96408 | ||||||||||||||||||||||||
| 146 | { | - | ||||||||||||||||||||||||
| 147 | global_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 148 | ((void *)0) | - | ||||||||||||||||||||||||
| 149 | ; | - | ||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | if (interactive
| 0-96408 | ||||||||||||||||||||||||
| 154 | { | - | ||||||||||||||||||||||||
| 155 | char *ps0_string; | - | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | ps0_string = decode_prompt_string (ps0_prompt); | - | ||||||||||||||||||||||||
| 158 | if (ps0_string
| 0 | ||||||||||||||||||||||||
| 159 | { | - | ||||||||||||||||||||||||
| 160 | fprintf ( | - | ||||||||||||||||||||||||
| 161 | stderr | - | ||||||||||||||||||||||||
| 162 | , "%s", ps0_string); | - | ||||||||||||||||||||||||
| 163 | fflush ( | - | ||||||||||||||||||||||||
| 164 | stderr | - | ||||||||||||||||||||||||
| 165 | ); | - | ||||||||||||||||||||||||
| 166 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 167 | sh_xfree((ps0_string), "eval.c", 164); | - | ||||||||||||||||||||||||
| 168 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||
| 170 | current_command_number++; | - | ||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | executing = 1; | - | ||||||||||||||||||||||||
| 173 | stdin_redir = 0; | - | ||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||
| 175 | execute_command (current_command); | - | ||||||||||||||||||||||||
| 176 | - | |||||||||||||||||||||||||
| 177 | exec_done: code before this statement executed 91108 times by 1 test: exec_done:Executed by:
| 91108 | ||||||||||||||||||||||||
| 178 | do { if (terminating_signal
never executed: if (interrupt_statetermsig_handler (terminating_signal);
never executed: } while (0);throw_to_top_level (); | 0-91171 | ||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||
| 180 | if (current_command
| 63-91108 | ||||||||||||||||||||||||
| 181 | { | - | ||||||||||||||||||||||||
| 182 | dispose_command (current_command); | - | ||||||||||||||||||||||||
| 183 | current_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 184 | ((void *)0) | - | ||||||||||||||||||||||||
| 185 | ; | - | ||||||||||||||||||||||||
| 186 | } executed 91108 times by 1 test: end of blockExecuted by:
| 91108 | ||||||||||||||||||||||||
| 187 | } executed 91171 times by 1 test: end of blockExecuted by:
| 91171 | ||||||||||||||||||||||||
| 188 | } executed 171144 times by 1 test: end of blockExecuted by:
| 171144 | ||||||||||||||||||||||||
| 189 | else | - | ||||||||||||||||||||||||
| 190 | { | - | ||||||||||||||||||||||||
| 191 | - | |||||||||||||||||||||||||
| 192 | if (interactive == 0
| 0-6 | ||||||||||||||||||||||||
| 193 | EOF_Reached = executed 6 times by 1 test: EOF_Reached = (-1) ;Executed by:
| 6 | ||||||||||||||||||||||||
| 194 | (-1) executed 6 times by 1 test: EOF_Reached = (-1) ;Executed by:
| 6 | ||||||||||||||||||||||||
| 195 | ; executed 6 times by 1 test: EOF_Reached = (-1) ;Executed by:
| 6 | ||||||||||||||||||||||||
| 196 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 197 | if (just_one_command
| 1-171149 | ||||||||||||||||||||||||
| 198 | EOF_Reached = executed 1 time by 1 test: EOF_Reached = (-1) ;Executed by:
| 1 | ||||||||||||||||||||||||
| 199 | (-1) executed 1 time by 1 test: EOF_Reached = (-1) ;Executed by:
| 1 | ||||||||||||||||||||||||
| 200 | ; executed 1 time by 1 test: EOF_Reached = (-1) ;Executed by:
| 1 | ||||||||||||||||||||||||
| 201 | } executed 171150 times by 1 test: end of blockExecuted by:
| 171150 | ||||||||||||||||||||||||
| 202 | indirection_level--; | - | ||||||||||||||||||||||||
| 203 | return executed 399 times by 1 test: (last_command_exit_value);return (last_command_exit_value);Executed by:
executed 399 times by 1 test: return (last_command_exit_value);Executed by:
| 399 | ||||||||||||||||||||||||
| 204 | } | - | ||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||
| 207 | int | - | ||||||||||||||||||||||||
| 208 | pretty_print_loop () | - | ||||||||||||||||||||||||
| 209 | { | - | ||||||||||||||||||||||||
| 210 | COMMAND *current_command; | - | ||||||||||||||||||||||||
| 211 | char *command_to_print; | - | ||||||||||||||||||||||||
| 212 | int code; | - | ||||||||||||||||||||||||
| 213 | int global_posix_mode, last_was_newline; | - | ||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||
| 215 | global_posix_mode = posixly_correct; | - | ||||||||||||||||||||||||
| 216 | last_was_newline = 0; | - | ||||||||||||||||||||||||
| 217 | while (EOF_Reached == 0
| 0 | ||||||||||||||||||||||||
| 218 | { | - | ||||||||||||||||||||||||
| 219 | code = | - | ||||||||||||||||||||||||
| 220 | __sigsetjmp ( | - | ||||||||||||||||||||||||
| 221 | (top_level) | - | ||||||||||||||||||||||||
| 222 | , | - | ||||||||||||||||||||||||
| 223 | 0 | - | ||||||||||||||||||||||||
| 224 | ) | - | ||||||||||||||||||||||||
| 225 | ; | - | ||||||||||||||||||||||||
| 226 | if (code
| 0 | ||||||||||||||||||||||||
| 227 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||
| 228 | if (read_command() == 0
| 0 | ||||||||||||||||||||||||
| 229 | { | - | ||||||||||||||||||||||||
| 230 | current_command = global_command; | - | ||||||||||||||||||||||||
| 231 | global_command = 0; | - | ||||||||||||||||||||||||
| 232 | posixly_correct = 1; | - | ||||||||||||||||||||||||
| 233 | if (current_command
| 0 | ||||||||||||||||||||||||
| 234 | { | - | ||||||||||||||||||||||||
| 235 | printf ("%s\n", command_to_print); | - | ||||||||||||||||||||||||
| 236 | last_was_newline = 0; | - | ||||||||||||||||||||||||
| 237 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 238 | else if (last_was_newline == 0
| 0 | ||||||||||||||||||||||||
| 239 | { | - | ||||||||||||||||||||||||
| 240 | printf ("\n"); | - | ||||||||||||||||||||||||
| 241 | last_was_newline = 1; | - | ||||||||||||||||||||||||
| 242 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 243 | posixly_correct = global_posix_mode; | - | ||||||||||||||||||||||||
| 244 | dispose_command (current_command); | - | ||||||||||||||||||||||||
| 245 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 246 | else | - | ||||||||||||||||||||||||
| 247 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||
| 248 | } | - | ||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||
| 250 | return never executed: (0);return (0);never executed: return (0); | 0 | ||||||||||||||||||||||||
| 251 | } | - | ||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 | static void | - | ||||||||||||||||||||||||
| 254 | alrm_catcher(i) | - | ||||||||||||||||||||||||
| 255 | int i; | - | ||||||||||||||||||||||||
| 256 | { | - | ||||||||||||||||||||||||
| 257 | printf ( | - | ||||||||||||||||||||||||
| 258 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||
| 259 | "\007timed out waiting for input: auto-logout\n" | - | ||||||||||||||||||||||||
| 260 | , 5) | - | ||||||||||||||||||||||||
| 261 | ); | - | ||||||||||||||||||||||||
| 262 | fflush ( | - | ||||||||||||||||||||||||
| 263 | stdout | - | ||||||||||||||||||||||||
| 264 | ); | - | ||||||||||||||||||||||||
| 265 | bash_logout (); | - | ||||||||||||||||||||||||
| 266 | jump_to_top_level (3); | - | ||||||||||||||||||||||||
| 267 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 268 | } | - | ||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | static void | - | ||||||||||||||||||||||||
| 273 | send_pwd_to_eterm () | - | ||||||||||||||||||||||||
| 274 | { | - | ||||||||||||||||||||||||
| 275 | char *pwd, *f; | - | ||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||
| 277 | f = 0; | - | ||||||||||||||||||||||||
| 278 | pwd = get_string_value ("PWD"); | - | ||||||||||||||||||||||||
| 279 | if (pwd == 0
| 0 | ||||||||||||||||||||||||
| 280 | f = pwd = get_working_directory ("eterm"); never executed: f = pwd = get_working_directory ("eterm"); | 0 | ||||||||||||||||||||||||
| 281 | fprintf ( | - | ||||||||||||||||||||||||
| 282 | stderr | - | ||||||||||||||||||||||||
| 283 | , "\032/%s\n", pwd); | - | ||||||||||||||||||||||||
| 284 | sh_xfree((f), "eval.c", 261); | - | ||||||||||||||||||||||||
| 285 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | static void | - | ||||||||||||||||||||||||
| 288 | execute_prompt_command () | - | ||||||||||||||||||||||||
| 289 | { | - | ||||||||||||||||||||||||
| 290 | char *command_to_execute; | - | ||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | command_to_execute = get_string_value ("PROMPT_COMMAND"); | - | ||||||||||||||||||||||||
| 293 | if (command_to_execute
| 0 | ||||||||||||||||||||||||
| 294 | execute_variable_command (command_to_execute, "PROMPT_COMMAND"); never executed: execute_variable_command (command_to_execute, "PROMPT_COMMAND"); | 0 | ||||||||||||||||||||||||
| 295 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | int | - | ||||||||||||||||||||||||
| 301 | parse_command () | - | ||||||||||||||||||||||||
| 302 | { | - | ||||||||||||||||||||||||
| 303 | int r; | - | ||||||||||||||||||||||||
| 304 | - | |||||||||||||||||||||||||
| 305 | need_here_doc = 0; | - | ||||||||||||||||||||||||
| 306 | run_pending_traps (); | - | ||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | if (interactive
| 0-907954 | ||||||||||||||||||||||||
| 315 | { | - | ||||||||||||||||||||||||
| 316 | execute_prompt_command (); | - | ||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||
| 318 | if (running_under_emacs == 2
| 0 | ||||||||||||||||||||||||
| 319 | send_pwd_to_eterm (); never executed: send_pwd_to_eterm (); | 0 | ||||||||||||||||||||||||
| 320 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | current_command_line_count = 0; | - | ||||||||||||||||||||||||
| 323 | r = yyparse (); | - | ||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||
| 325 | if (need_here_doc
| 2-907934 | ||||||||||||||||||||||||
| 326 | gather_here_documents (); executed 2 times by 1 test: gather_here_documents ();Executed by:
| 2 | ||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | return executed 907936 times by 1 test: (r);return (r);Executed by:
executed 907936 times by 1 test: return (r);Executed by:
| 907936 | ||||||||||||||||||||||||
| 329 | } | - | ||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||
| 333 | - | |||||||||||||||||||||||||
| 334 | int | - | ||||||||||||||||||||||||
| 335 | read_command () | - | ||||||||||||||||||||||||
| 336 | { | - | ||||||||||||||||||||||||
| 337 | SHELL_VAR *tmout_var; | - | ||||||||||||||||||||||||
| 338 | int tmout_len, result; | - | ||||||||||||||||||||||||
| 339 | SigHandler *old_alrm; | - | ||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||
| 341 | set_current_prompt_level (1); | - | ||||||||||||||||||||||||
| 342 | global_command = (COMMAND *) | - | ||||||||||||||||||||||||
| 343 | ((void *)0) | - | ||||||||||||||||||||||||
| 344 | ; | - | ||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||
| 347 | tmout_var = (SHELL_VAR *) | - | ||||||||||||||||||||||||
| 348 | ((void *)0) | - | ||||||||||||||||||||||||
| 349 | ; | - | ||||||||||||||||||||||||
| 350 | tmout_len = 0; | - | ||||||||||||||||||||||||
| 351 | old_alrm = (SigHandler *) | - | ||||||||||||||||||||||||
| 352 | ((void *)0) | - | ||||||||||||||||||||||||
| 353 | ; | - | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | if (interactive
| 0-176405 | ||||||||||||||||||||||||
| 356 | { | - | ||||||||||||||||||||||||
| 357 | tmout_var = find_variable ("TMOUT"); | - | ||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||
| 359 | if (tmout_var
| 0 | ||||||||||||||||||||||||
| 360 | { | - | ||||||||||||||||||||||||
| 361 | tmout_len = atoi (((tmout_var)->value)); | - | ||||||||||||||||||||||||
| 362 | if (tmout_len > 0
| 0 | ||||||||||||||||||||||||
| 363 | { | - | ||||||||||||||||||||||||
| 364 | old_alrm = set_signal_handler ( | - | ||||||||||||||||||||||||
| 365 | 14 | - | ||||||||||||||||||||||||
| 366 | , alrm_catcher); | - | ||||||||||||||||||||||||
| 367 | alarm (tmout_len); | - | ||||||||||||||||||||||||
| 368 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 369 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 370 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | do { if (terminating_signal
never executed: if (interrupt_statetermsig_handler (terminating_signal);
never executed: } while (0);throw_to_top_level (); | 0-176405 | ||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 | current_command_line_count = 0; | - | ||||||||||||||||||||||||
| 375 | result = parse_command (); | - | ||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||
| 377 | if (interactive
| 0-176387 | ||||||||||||||||||||||||
| 378 | { | - | ||||||||||||||||||||||||
| 379 | alarm(0); | - | ||||||||||||||||||||||||
| 380 | set_signal_handler ( | - | ||||||||||||||||||||||||
| 381 | 14 | - | ||||||||||||||||||||||||
| 382 | , old_alrm); | - | ||||||||||||||||||||||||
| 383 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | return executed 176387 times by 1 test: (result);return (result);Executed by:
executed 176387 times by 1 test: return (result);Executed by:
| 176387 | ||||||||||||||||||||||||
| 386 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |