| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | %{ | - |
| 22 | #include "config.h" | - |
| 23 | | - |
| 24 | #include "bashtypes.h" | - |
| 25 | #include "bashansi.h" | - |
| 26 | | - |
| 27 | #include "filecntl.h" | - |
| 28 | | - |
| 29 | #if defined (HAVE_UNISTD_H) | - |
| 30 | # include <unistd.h> | - |
| 31 | #endif | - |
| 32 | | - |
| 33 | #if defined (HAVE_LOCALE_H) | - |
| 34 | # include <locale.h> | - |
| 35 | #endif | - |
| 36 | | - |
| 37 | #include <stdio.h> | - |
| 38 | #include "chartypes.h" | - |
| 39 | #include <signal.h> | - |
| 40 | | - |
| 41 | #include "memalloc.h" | - |
| 42 | | - |
| 43 | #include "bashintl.h" | - |
| 44 | | - |
| 45 | #define NEED_STRFTIME_DECL /* used in externs.h */ | - |
| 46 | | - |
| 47 | #include "shell.h" | - |
| 48 | #include "execute_cmd.h" | - |
| 49 | #include "typemax.h" /* SIZE_MAX if needed */ | - |
| 50 | #include "trap.h" | - |
| 51 | #include "flags.h" | - |
| 52 | #include "parser.h" | - |
| 53 | #include "mailcheck.h" | - |
| 54 | #include "test.h" | - |
| 55 | #include "builtins.h" | - |
| 56 | #include "builtins/common.h" | - |
| 57 | #include "builtins/builtext.h" | - |
| 58 | | - |
| 59 | #include "shmbutil.h" | - |
| 60 | | - |
| 61 | #if defined (READLINE) | - |
| 62 | # include "bashline.h" | - |
| 63 | # include <readline/readline.h> | - |
| 64 | #endif /* READLINE */ | - |
| 65 | | - |
| 66 | #if defined (HISTORY) | - |
| 67 | # include "bashhist.h" | - |
| 68 | # include <readline/history.h> | - |
| 69 | #endif /* HISTORY */ | - |
| 70 | | - |
| 71 | #if defined (JOB_CONTROL) | - |
| 72 | # include "jobs.h" | - |
| 73 | #else | - |
| 74 | extern int cleanup_dead_jobs __P((void)); | - |
| 75 | #endif /* JOB_CONTROL */ | - |
| 76 | | - |
| 77 | #if defined (ALIAS) | - |
| 78 | # include "alias.h" | - |
| 79 | #else | - |
| 80 | typedef void *alias_t; | - |
| 81 | #endif /* ALIAS */ | - |
| 82 | | - |
| 83 | #if defined (PROMPT_STRING_DECODE) | - |
| 84 | # ifndef _MINIX | - |
| 85 | # include <sys/param.h> | - |
| 86 | # endif | - |
| 87 | # include <time.h> | - |
| 88 | # if defined (TM_IN_SYS_TIME) | - |
| 89 | # include <sys/types.h> | - |
| 90 | # include <sys/time.h> | - |
| 91 | # endif /* TM_IN_SYS_TIME */ | - |
| 92 | # include "maxpath.h" | - |
| 93 | #endif /* PROMPT_STRING_DECODE */ | - |
| 94 | | - |
| 95 | #define RE_READ_TOKEN -99 | - |
| 96 | #define NO_EXPANSION -100 | - |
| 97 | | - |
| 98 | #define END_ALIAS -2 | - |
| 99 | | - |
| 100 | #ifdef DEBUG | - |
| 101 | # define YYDEBUG 1 | - |
| 102 | #else | - |
| 103 | # define YYDEBUG 0 | - |
| 104 | #endif | - |
| 105 | | - |
| 106 | #if defined (HANDLE_MULTIBYTE) | - |
| 107 | # define last_shell_getc_is_singlebyte \ | - |
| 108 | ((shell_input_line_index > 1) \ | - |
| 109 | ? shell_input_line_property[shell_input_line_index - 1] \ | - |
| 110 | : 1) | - |
| 111 | # define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) | - |
| 112 | #else | - |
| 113 | # define last_shell_getc_is_singlebyte 1 | - |
| 114 | # define MBTEST(x) ((x)) | - |
| 115 | #endif | - |
| 116 | | - |
| 117 | #if defined (EXTENDED_GLOB) | - |
| 118 | extern int extended_glob; | - |
| 119 | #endif | - |
| 120 | | - |
| 121 | extern int dump_translatable_strings, dump_po_strings; | - |
| 122 | | - |
| 123 | #if !defined (errno) | - |
| 124 | extern int errno; | - |
| 125 | #endif | - |
| 126 | | - |
| 127 | | - |
| 128 | | - |
| 129 | | - |
| 130 | | - |
| 131 | | - |
| 132 | | - |
| 133 | #ifdef DEBUG | - |
| 134 | static void debug_parser __P((int)); | - |
| 135 | #endif | - |
| 136 | | - |
| 137 | static int yy_getc __P((void)); | - |
| 138 | static int yy_ungetc __P((int)); | - |
| 139 | | - |
| 140 | #if defined (READLINE) | - |
| 141 | static int yy_readline_get __P((void)); | - |
| 142 | static int yy_readline_unget __P((int)); | - |
| 143 | #endif | - |
| 144 | | - |
| 145 | static int yy_string_get __P((void)); | - |
| 146 | static int yy_string_unget __P((int)); | - |
| 147 | static void rewind_input_string __P((void)); | - |
| 148 | static int yy_stream_get __P((void)); | - |
| 149 | static int yy_stream_unget __P((int)); | - |
| 150 | | - |
| 151 | static int shell_getc __P((int)); | - |
| 152 | static void shell_ungetc __P((int)); | - |
| 153 | static void discard_until __P((int)); | - |
| 154 | | - |
| 155 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 156 | static void push_string __P((char *, int, alias_t *)); | - |
| 157 | static void pop_string __P((void)); | - |
| 158 | static void free_string_list __P((void)); | - |
| 159 | #endif | - |
| 160 | | - |
| 161 | static char *read_a_line __P((int)); | - |
| 162 | | - |
| 163 | static int reserved_word_acceptable __P((int)); | - |
| 164 | static int yylex __P((void)); | - |
| 165 | | - |
| 166 | static void push_heredoc __P((REDIRECT *)); | - |
| 167 | static char *mk_alexpansion __P((char *)); | - |
| 168 | static int alias_expand_token __P((char *)); | - |
| 169 | static int time_command_acceptable __P((void)); | - |
| 170 | static int special_case_tokens __P((char *)); | - |
| 171 | static int read_token __P((int)); | - |
| 172 | static char *parse_matched_pair __P((int, int, int, int *, int)); | - |
| 173 | static char *parse_comsub __P((int, int, int, int *, int)); | - |
| 174 | #if defined (ARRAY_VARS) | - |
| 175 | static char *parse_compound_assignment __P((int *)); | - |
| 176 | #endif | - |
| 177 | #if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) | - |
| 178 | static int parse_dparen __P((int)); | - |
| 179 | static int parse_arith_cmd __P((char **, int)); | - |
| 180 | #endif | - |
| 181 | #if defined (COND_COMMAND) | - |
| 182 | static void cond_error __P((void)); | - |
| 183 | static COND_COM *cond_expr __P((void)); | - |
| 184 | static COND_COM *cond_or __P((void)); | - |
| 185 | static COND_COM *cond_and __P((void)); | - |
| 186 | static COND_COM *cond_term __P((void)); | - |
| 187 | static int cond_skip_newlines __P((void)); | - |
| 188 | static COMMAND *parse_cond_command __P((void)); | - |
| 189 | #endif | - |
| 190 | #if defined (ARRAY_VARS) | - |
| 191 | static int token_is_assignment __P((char *, int)); | - |
| 192 | static int token_is_ident __P((char *, int)); | - |
| 193 | #endif | - |
| 194 | static int read_token_word __P((int)); | - |
| 195 | static void discard_parser_constructs __P((int)); | - |
| 196 | | - |
| 197 | static char *error_token_from_token __P((int)); | - |
| 198 | static char *error_token_from_text __P((void)); | - |
| 199 | static void print_offending_line __P((void)); | - |
| 200 | static void report_syntax_error __P((char *)); | - |
| 201 | | - |
| 202 | static void handle_eof_input_unit __P((void)); | - |
| 203 | static void prompt_again __P((void)); | - |
| 204 | #if 0 | - |
| 205 | static void reset_readline_prompt __P((void)); | - |
| 206 | #endif | - |
| 207 | static void print_prompt __P((void)); | - |
| 208 | | - |
| 209 | #if defined (HANDLE_MULTIBYTE) | - |
| 210 | static void set_line_mbstate __P((void)); | - |
| 211 | static char *shell_input_line_property = NULL; | - |
| 212 | static size_t shell_input_line_propsize = 0; | - |
| 213 | #else | - |
| 214 | # define set_line_mbstate() | - |
| 215 | #endif | - |
| 216 | | - |
| 217 | extern int yyerror __P((const char *)); | - |
| 218 | | - |
| 219 | #ifdef DEBUG | - |
| 220 | extern int yydebug; | - |
| 221 | #endif | - |
| 222 | | - |
| 223 | | - |
| 224 | char *primary_prompt = PPROMPT; | - |
| 225 | char *secondary_prompt = SPROMPT; | - |
| 226 | | - |
| 227 | | - |
| 228 | char *ps1_prompt, *ps2_prompt; | - |
| 229 | | - |
| 230 | | - |
| 231 | char *ps0_prompt; | - |
| 232 | | - |
| 233 | | - |
| 234 | | - |
| 235 | char **prompt_string_pointer = (char **)NULL; | - |
| 236 | char *current_prompt_string; | - |
| 237 | | - |
| 238 | | - |
| 239 | int expand_aliases = 0; | - |
| 240 | | - |
| 241 | | - |
| 242 | | - |
| 243 | | - |
| 244 | | - |
| 245 | int promptvars = 1; | - |
| 246 | | - |
| 247 | | - |
| 248 | | - |
| 249 | | - |
| 250 | int extended_quote = 1; | - |
| 251 | | - |
| 252 | | - |
| 253 | int current_command_line_count; | - |
| 254 | | - |
| 255 | | - |
| 256 | int saved_command_line_count; | - |
| 257 | | - |
| 258 | | - |
| 259 | int shell_eof_token; | - |
| 260 | | - |
| 261 | | - |
| 262 | int current_token; | - |
| 263 | | - |
| 264 | | - |
| 265 | int parser_state; | - |
| 266 | | - |
| 267 | | - |
| 268 | | - |
| 269 | static REDIRECT *redir_stack[HEREDOC_MAX]; | - |
| 270 | int need_here_doc; | - |
| 271 | | - |
| 272 | | - |
| 273 | | - |
| 274 | static char *shell_input_line = (char *)NULL; | - |
| 275 | static size_t shell_input_line_index; | - |
| 276 | static size_t shell_input_line_size; | - |
| 277 | static size_t shell_input_line_len; | - |
| 278 | | - |
| 279 | | - |
| 280 | static int shell_input_line_terminator; | - |
| 281 | | - |
| 282 | | - |
| 283 | static int function_dstart; | - |
| 284 | | - |
| 285 | | - |
| 286 | static int function_bstart; | - |
| 287 | | - |
| 288 | | - |
| 289 | static int arith_for_lineno; | - |
| 290 | | - |
| 291 | | - |
| 292 | | - |
| 293 | static char *current_decoded_prompt; | - |
| 294 | | - |
| 295 | | - |
| 296 | | - |
| 297 | static int last_read_token; | - |
| 298 | | - |
| 299 | | - |
| 300 | static int token_before_that; | - |
| 301 | | - |
| 302 | | - |
| 303 | static int two_tokens_ago; | - |
| 304 | | - |
| 305 | static int global_extglob; | - |
| 306 | | - |
| 307 | | - |
| 308 | | - |
| 309 | | - |
| 310 | #define MAX_CASE_NEST 128 | - |
| 311 | static int word_lineno[MAX_CASE_NEST+1]; | - |
| 312 | static int word_top = -1; | - |
| 313 | | - |
| 314 | | - |
| 315 | | - |
| 316 | | - |
| 317 | | - |
| 318 | static int token_to_read; | - |
| 319 | static WORD_DESC *word_desc_to_read; | - |
| 320 | | - |
| 321 | static REDIRECTEE source; | - |
| 322 | static REDIRECTEE redir; | - |
| 323 | | - |
| 324 | static FILE *yyoutstream; | - |
| 325 | static FILE *yyerrstream; | - |
| 326 | %} | - |
| 327 | | - |
| 328 | %union { | - |
| 329 | WORD_DESC *word; | - |
| 330 | int number; | - |
| 331 | WORD_LIST *word_list; | - |
| 332 | COMMAND *command; | - |
| 333 | REDIRECT *redirect; | - |
| 334 | ELEMENT element; | - |
| 335 | PATTERN_LIST *pattern; | - |
| 336 | } | - |
| 337 | | - |
| 338 | | - |
| 339 | | - |
| 340 | | - |
| 341 | | - |
| 342 | %token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC | - |
| 343 | %token COND_START COND_END COND_ERROR | - |
| 344 | %token IN BANG TIME TIMEOPT TIMEIGN | - |
| 345 | | - |
| 346 | | - |
| 347 | %token <word> WORD ASSIGNMENT_WORD REDIR_WORD | - |
| 348 | %token <number> NUMBER | - |
| 349 | %token <word_list> ARITH_CMD ARITH_FOR_EXPRS | - |
| 350 | %token <command> COND_CMD | - |
| 351 | %token AND_AND OR_OR GREATER_GREATER LESS_LESS LESS_AND LESS_LESS_LESS | - |
| 352 | %token GREATER_AND SEMI_SEMI SEMI_AND SEMI_SEMI_AND | - |
| 353 | %token LESS_LESS_MINUS AND_GREATER AND_GREATER_GREATER LESS_GREATER | - |
| 354 | %token GREATER_BAR BAR_AND | - |
| 355 | | - |
| 356 | | - |
| 357 | | - |
| 358 | %type <command> inputunit command pipeline pipeline_command | - |
| 359 | %type <command> list list0 list1 compound_list simple_list simple_list1 | - |
| 360 | %type <command> simple_command shell_command | - |
| 361 | %type <command> for_command select_command case_command group_command | - |
| 362 | %type <command> arith_command | - |
| 363 | %type <command> cond_command | - |
| 364 | %type <command> arith_for_command | - |
| 365 | %type <command> coproc | - |
| 366 | %type <command> function_def function_body if_command elif_clause subshell | - |
| 367 | %type <redirect> redirection redirection_list | - |
| 368 | %type <element> simple_command_element | - |
| 369 | %type <word_list> word_list pattern | - |
| 370 | %type <pattern> pattern_list case_clause_sequence case_clause | - |
| 371 | %type <number> timespec | - |
| 372 | %type <number> list_terminator | - |
| 373 | | - |
| 374 | %start inputunit | - |
| 375 | | - |
| 376 | %left '&' ';' '\n' yacc_EOF | - |
| 377 | %left AND_AND OR_OR | - |
| 378 | %right '|' BAR_AND | - |
| 379 | %% | - |
| 380 | | - |
| 381 | inputunit: simple_list simple_list_terminator | - |
| 382 | { | - |
| 383 | | - |
| 384 | | - |
| 385 | global_command = $1; | - |
| 386 | eof_encountered = 0; | - |
| 387 | | - |
| 388 | if (parser_state & PST_CMDSUBST)| TRUE | evaluated 838 times by 1 test | | FALSE | evaluated 119351 times by 1 test |
| 838-119351 |
| 389 | parser_state |= PST_EOFTOKEN;executed 838 times by 1 test: parser_state |= 0x008000; | 838 |
| 390 | YYACCEPT;executed 120189 times by 1 test: goto yyacceptlab; | 120189 |
| 391 | } | - |
| 392 | | '\n' | - |
| 393 | { | - |
| 394 | | - |
| 395 | | - |
| 396 | global_command = (COMMAND *)NULL; | - |
| 397 | if (parser_state & PST_CMDSUBST)| TRUE | evaluated 452 times by 1 test | | FALSE | evaluated 81648 times by 1 test |
| 452-81648 |
| 398 | parser_state |= PST_EOFTOKEN;executed 452 times by 1 test: parser_state |= 0x008000; | 452 |
| 399 | YYACCEPT;executed 82100 times by 1 test: goto yyacceptlab; | 82100 |
| 400 | } | - |
| 401 | | error '\n' | - |
| 402 | { | - |
| 403 | | - |
| 404 | global_command = (COMMAND *)NULL; | - |
| 405 | eof_encountered = 0; | - |
| 406 | | - |
| 407 | if (interactive && parse_and_execute_level == 0)| TRUE | never evaluated | | FALSE | evaluated 22 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-22 |
| 408 | { | - |
| 409 | YYACCEPT; never executed: goto yyacceptlab; | 0 |
| 410 | } | - |
| 411 | else | - |
| 412 | { | - |
| 413 | YYABORT;executed 22 times by 1 test: goto yyabortlab; | 22 |
| 414 | } | - |
| 415 | } | - |
| 416 | | error yacc_EOF | - |
| 417 | { | - |
| 418 | | - |
| 419 | | - |
| 420 | global_command = (COMMAND *)NULL; | - |
| 421 | last_command_exit_value = 1; | - |
| 422 | handle_eof_input_unit (); | - |
| 423 | if (interactive && parse_and_execute_level == 0)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-2 |
| 424 | { | - |
| 425 | YYACCEPT; never executed: goto yyacceptlab; | 0 |
| 426 | } | - |
| 427 | else | - |
| 428 | { | - |
| 429 | YYABORT;executed 2 times by 1 test: goto yyabortlab; | 2 |
| 430 | } | - |
| 431 | } | - |
| 432 | | yacc_EOF | - |
| 433 | { | - |
| 434 | | - |
| 435 | | - |
| 436 | global_command = (COMMAND *)NULL; | - |
| 437 | handle_eof_input_unit (); | - |
| 438 | YYACCEPT;executed 1290 times by 1 test: goto yyacceptlab; | 1290 |
| 439 | } | - |
| 440 | ; | - |
| 441 | | - |
| 442 | word_list: WORD | - |
| 443 | { $$ = make_word_list ($1, (WORD_LIST *)NULL); } | - |
| 444 | | word_list WORD | - |
| 445 | { $$ = make_word_list ($2, $1); } | - |
| 446 | ; | - |
| 447 | | - |
| 448 | redirection: '>' WORD | - |
| 449 | { | - |
| 450 | source.dest = 1; | - |
| 451 | redir.filename = $2; | - |
| 452 | $$ = make_redirection (source, r_output_direction, redir, 0); | - |
| 453 | } | - |
| 454 | | '<' WORD | - |
| 455 | { | - |
| 456 | source.dest = 0; | - |
| 457 | redir.filename = $2; | - |
| 458 | $$ = make_redirection (source, r_input_direction, redir, 0); | - |
| 459 | } | - |
| 460 | | NUMBER '>' WORD | - |
| 461 | { | - |
| 462 | source.dest = $1; | - |
| 463 | redir.filename = $3; | - |
| 464 | $$ = make_redirection (source, r_output_direction, redir, 0); | - |
| 465 | } | - |
| 466 | | NUMBER '<' WORD | - |
| 467 | { | - |
| 468 | source.dest = $1; | - |
| 469 | redir.filename = $3; | - |
| 470 | $$ = make_redirection (source, r_input_direction, redir, 0); | - |
| 471 | } | - |
| 472 | | REDIR_WORD '>' WORD | - |
| 473 | { | - |
| 474 | source.filename = $1; | - |
| 475 | redir.filename = $3; | - |
| 476 | $$ = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); | - |
| 477 | } | - |
| 478 | | REDIR_WORD '<' WORD | - |
| 479 | { | - |
| 480 | source.filename = $1; | - |
| 481 | redir.filename = $3; | - |
| 482 | $$ = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); | - |
| 483 | } | - |
| 484 | | GREATER_GREATER WORD | - |
| 485 | { | - |
| 486 | source.dest = 1; | - |
| 487 | redir.filename = $2; | - |
| 488 | $$ = make_redirection (source, r_appending_to, redir, 0); | - |
| 489 | } | - |
| 490 | | NUMBER GREATER_GREATER WORD | - |
| 491 | { | - |
| 492 | source.dest = $1; | - |
| 493 | redir.filename = $3; | - |
| 494 | $$ = make_redirection (source, r_appending_to, redir, 0); | - |
| 495 | } | - |
| 496 | | REDIR_WORD GREATER_GREATER WORD | - |
| 497 | { | - |
| 498 | source.filename = $1; | - |
| 499 | redir.filename = $3; | - |
| 500 | $$ = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); | - |
| 501 | } | - |
| 502 | | GREATER_BAR WORD | - |
| 503 | { | - |
| 504 | source.dest = 1; | - |
| 505 | redir.filename = $2; | - |
| 506 | $$ = make_redirection (source, r_output_force, redir, 0); | - |
| 507 | } | - |
| 508 | | NUMBER GREATER_BAR WORD | - |
| 509 | { | - |
| 510 | source.dest = $1; | - |
| 511 | redir.filename = $3; | - |
| 512 | $$ = make_redirection (source, r_output_force, redir, 0); | - |
| 513 | } | - |
| 514 | | REDIR_WORD GREATER_BAR WORD | - |
| 515 | { | - |
| 516 | source.filename = $1; | - |
| 517 | redir.filename = $3; | - |
| 518 | $$ = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); | - |
| 519 | } | - |
| 520 | | LESS_GREATER WORD | - |
| 521 | { | - |
| 522 | source.dest = 0; | - |
| 523 | redir.filename = $2; | - |
| 524 | $$ = make_redirection (source, r_input_output, redir, 0); | - |
| 525 | } | - |
| 526 | | NUMBER LESS_GREATER WORD | - |
| 527 | { | - |
| 528 | source.dest = $1; | - |
| 529 | redir.filename = $3; | - |
| 530 | $$ = make_redirection (source, r_input_output, redir, 0); | - |
| 531 | } | - |
| 532 | | REDIR_WORD LESS_GREATER WORD | - |
| 533 | { | - |
| 534 | source.filename = $1; | - |
| 535 | redir.filename = $3; | - |
| 536 | $$ = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); | - |
| 537 | } | - |
| 538 | | LESS_LESS WORD | - |
| 539 | { | - |
| 540 | source.dest = 0; | - |
| 541 | redir.filename = $2; | - |
| 542 | $$ = make_redirection (source, r_reading_until, redir, 0); | - |
| 543 | push_heredoc ($$); | - |
| 544 | } | - |
| 545 | | NUMBER LESS_LESS WORD | - |
| 546 | { | - |
| 547 | source.dest = $1; | - |
| 548 | redir.filename = $3; | - |
| 549 | $$ = make_redirection (source, r_reading_until, redir, 0); | - |
| 550 | push_heredoc ($$); | - |
| 551 | } | - |
| 552 | | REDIR_WORD LESS_LESS WORD | - |
| 553 | { | - |
| 554 | source.filename = $1; | - |
| 555 | redir.filename = $3; | - |
| 556 | $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); | - |
| 557 | push_heredoc ($$); | - |
| 558 | } | - |
| 559 | | LESS_LESS_MINUS WORD | - |
| 560 | { | - |
| 561 | source.dest = 0; | - |
| 562 | redir.filename = $2; | - |
| 563 | $$ = make_redirection (source, r_deblank_reading_until, redir, 0); | - |
| 564 | push_heredoc ($$); | - |
| 565 | } | - |
| 566 | | NUMBER LESS_LESS_MINUS WORD | - |
| 567 | { | - |
| 568 | source.dest = $1; | - |
| 569 | redir.filename = $3; | - |
| 570 | $$ = make_redirection (source, r_deblank_reading_until, redir, 0); | - |
| 571 | push_heredoc ($$); | - |
| 572 | } | - |
| 573 | | REDIR_WORD LESS_LESS_MINUS WORD | - |
| 574 | { | - |
| 575 | source.filename = $1; | - |
| 576 | redir.filename = $3; | - |
| 577 | $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); | - |
| 578 | push_heredoc ($$); | - |
| 579 | } | - |
| 580 | | LESS_LESS_LESS WORD | - |
| 581 | { | - |
| 582 | source.dest = 0; | - |
| 583 | redir.filename = $2; | - |
| 584 | $$ = make_redirection (source, r_reading_string, redir, 0); | - |
| 585 | } | - |
| 586 | | NUMBER LESS_LESS_LESS WORD | - |
| 587 | { | - |
| 588 | source.dest = $1; | - |
| 589 | redir.filename = $3; | - |
| 590 | $$ = make_redirection (source, r_reading_string, redir, 0); | - |
| 591 | } | - |
| 592 | | REDIR_WORD LESS_LESS_LESS WORD | - |
| 593 | { | - |
| 594 | source.filename = $1; | - |
| 595 | redir.filename = $3; | - |
| 596 | $$ = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); | - |
| 597 | } | - |
| 598 | | LESS_AND NUMBER | - |
| 599 | { | - |
| 600 | source.dest = 0; | - |
| 601 | redir.dest = $2; | - |
| 602 | $$ = make_redirection (source, r_duplicating_input, redir, 0); | - |
| 603 | } | - |
| 604 | | NUMBER LESS_AND NUMBER | - |
| 605 | { | - |
| 606 | source.dest = $1; | - |
| 607 | redir.dest = $3; | - |
| 608 | $$ = make_redirection (source, r_duplicating_input, redir, 0); | - |
| 609 | } | - |
| 610 | | REDIR_WORD LESS_AND NUMBER | - |
| 611 | { | - |
| 612 | source.filename = $1; | - |
| 613 | redir.dest = $3; | - |
| 614 | $$ = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); | - |
| 615 | } | - |
| 616 | | GREATER_AND NUMBER | - |
| 617 | { | - |
| 618 | source.dest = 1; | - |
| 619 | redir.dest = $2; | - |
| 620 | $$ = make_redirection (source, r_duplicating_output, redir, 0); | - |
| 621 | } | - |
| 622 | | NUMBER GREATER_AND NUMBER | - |
| 623 | { | - |
| 624 | source.dest = $1; | - |
| 625 | redir.dest = $3; | - |
| 626 | $$ = make_redirection (source, r_duplicating_output, redir, 0); | - |
| 627 | } | - |
| 628 | | REDIR_WORD GREATER_AND NUMBER | - |
| 629 | { | - |
| 630 | source.filename = $1; | - |
| 631 | redir.dest = $3; | - |
| 632 | $$ = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); | - |
| 633 | } | - |
| 634 | | LESS_AND WORD | - |
| 635 | { | - |
| 636 | source.dest = 0; | - |
| 637 | redir.filename = $2; | - |
| 638 | $$ = make_redirection (source, r_duplicating_input_word, redir, 0); | - |
| 639 | } | - |
| 640 | | NUMBER LESS_AND WORD | - |
| 641 | { | - |
| 642 | source.dest = $1; | - |
| 643 | redir.filename = $3; | - |
| 644 | $$ = make_redirection (source, r_duplicating_input_word, redir, 0); | - |
| 645 | } | - |
| 646 | | REDIR_WORD LESS_AND WORD | - |
| 647 | { | - |
| 648 | source.filename = $1; | - |
| 649 | redir.filename = $3; | - |
| 650 | $$ = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); | - |
| 651 | } | - |
| 652 | | GREATER_AND WORD | - |
| 653 | { | - |
| 654 | source.dest = 1; | - |
| 655 | redir.filename = $2; | - |
| 656 | $$ = make_redirection (source, r_duplicating_output_word, redir, 0); | - |
| 657 | } | - |
| 658 | | NUMBER GREATER_AND WORD | - |
| 659 | { | - |
| 660 | source.dest = $1; | - |
| 661 | redir.filename = $3; | - |
| 662 | $$ = make_redirection (source, r_duplicating_output_word, redir, 0); | - |
| 663 | } | - |
| 664 | | REDIR_WORD GREATER_AND WORD | - |
| 665 | { | - |
| 666 | source.filename = $1; | - |
| 667 | redir.filename = $3; | - |
| 668 | $$ = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); | - |
| 669 | } | - |
| 670 | | GREATER_AND '-' | - |
| 671 | { | - |
| 672 | source.dest = 1; | - |
| 673 | redir.dest = 0; | - |
| 674 | $$ = make_redirection (source, r_close_this, redir, 0); | - |
| 675 | } | - |
| 676 | | NUMBER GREATER_AND '-' | - |
| 677 | { | - |
| 678 | source.dest = $1; | - |
| 679 | redir.dest = 0; | - |
| 680 | $$ = make_redirection (source, r_close_this, redir, 0); | - |
| 681 | } | - |
| 682 | | REDIR_WORD GREATER_AND '-' | - |
| 683 | { | - |
| 684 | source.filename = $1; | - |
| 685 | redir.dest = 0; | - |
| 686 | $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); | - |
| 687 | } | - |
| 688 | | LESS_AND '-' | - |
| 689 | { | - |
| 690 | source.dest = 0; | - |
| 691 | redir.dest = 0; | - |
| 692 | $$ = make_redirection (source, r_close_this, redir, 0); | - |
| 693 | } | - |
| 694 | | NUMBER LESS_AND '-' | - |
| 695 | { | - |
| 696 | source.dest = $1; | - |
| 697 | redir.dest = 0; | - |
| 698 | $$ = make_redirection (source, r_close_this, redir, 0); | - |
| 699 | } | - |
| 700 | | REDIR_WORD LESS_AND '-' | - |
| 701 | { | - |
| 702 | source.filename = $1; | - |
| 703 | redir.dest = 0; | - |
| 704 | $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); | - |
| 705 | } | - |
| 706 | | AND_GREATER WORD | - |
| 707 | { | - |
| 708 | source.dest = 1; | - |
| 709 | redir.filename = $2; | - |
| 710 | $$ = make_redirection (source, r_err_and_out, redir, 0); | - |
| 711 | } | - |
| 712 | | AND_GREATER_GREATER WORD | - |
| 713 | { | - |
| 714 | source.dest = 1; | - |
| 715 | redir.filename = $2; | - |
| 716 | $$ = make_redirection (source, r_append_err_and_out, redir, 0); | - |
| 717 | } | - |
| 718 | ; | - |
| 719 | | - |
| 720 | simple_command_element: WORD | - |
| 721 | { $$.word = $1; $$.redirect = 0; } | - |
| 722 | | ASSIGNMENT_WORD | - |
| 723 | { $$.word = $1; $$.redirect = 0; } | - |
| 724 | | redirection | - |
| 725 | { $$.redirect = $1; $$.word = 0; } | - |
| 726 | ; | - |
| 727 | | - |
| 728 | redirection_list: redirection | - |
| 729 | { | - |
| 730 | $$ = $1; | - |
| 731 | } | - |
| 732 | | redirection_list redirection | - |
| 733 | { | - |
| 734 | register REDIRECT *t; | - |
| 735 | | - |
| 736 | for (t = $1; t->next; t = t->next)| TRUE | never evaluated | | FALSE | evaluated 11 times by 1 test |
| 0-11 |
| 737 | ; never executed: ; | 0 |
| 738 | t->next = $2; | - |
| 739 | $$ = $1; | - |
| 740 | } | - |
| 741 | ; | - |
| 742 | | - |
| 743 | simple_command: simple_command_element | - |
| 744 | { $$ = make_simple_command ($1, (COMMAND *)NULL); } | - |
| 745 | | simple_command simple_command_element | - |
| 746 | { $$ = make_simple_command ($2, $1); } | - |
| 747 | ; | - |
| 748 | | - |
| 749 | command: simple_command | - |
| 750 | { $$ = clean_simple_command ($1); } | - |
| 751 | | shell_command | - |
| 752 | { $$ = $1; } | - |
| 753 | | shell_command redirection_list | - |
| 754 | { | - |
| 755 | COMMAND *tc; | - |
| 756 | | - |
| 757 | tc = $1; | - |
| 758 | if (tc && tc->redirects)| TRUE | evaluated 3093 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 3093 times by 1 test |
| 0-3093 |
| 759 | { | - |
| 760 | register REDIRECT *t; | - |
| 761 | for (t = tc->redirects; t->next; t = t->next)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 762 | ; never executed: ; | 0 |
| 763 | t->next = $2; | - |
| 764 | } never executed: end of block | 0 |
| 765 | else if (tc)| TRUE | evaluated 3093 times by 1 test | | FALSE | never evaluated |
| 0-3093 |
| 766 | tc->redirects = $2;executed 3093 times by 1 test: tc->redirects = (yyvsp[0].redirect); | 3093 |
| 767 | $$ = $1; | - |
| 768 | } | - |
| 769 | | function_def | - |
| 770 | { $$ = $1; } | - |
| 771 | | coproc | - |
| 772 | { $$ = $1; } | - |
| 773 | ; | - |
| 774 | | - |
| 775 | shell_command: for_command | - |
| 776 | { $$ = $1; } | - |
| 777 | | case_command | - |
| 778 | { $$ = $1; } | - |
| 779 | | WHILE compound_list DO compound_list DONE | - |
| 780 | { $$ = make_while_command ($2, $4); } | - |
| 781 | | UNTIL compound_list DO compound_list DONE | - |
| 782 | { $$ = make_until_command ($2, $4); } | - |
| 783 | | select_command | - |
| 784 | { $$ = $1; } | - |
| 785 | | if_command | - |
| 786 | { $$ = $1; } | - |
| 787 | | subshell | - |
| 788 | { $$ = $1; } | - |
| 789 | | group_command | - |
| 790 | { $$ = $1; } | - |
| 791 | | arith_command | - |
| 792 | { $$ = $1; } | - |
| 793 | | cond_command | - |
| 794 | { $$ = $1; } | - |
| 795 | | arith_for_command | - |
| 796 | { $$ = $1; } | - |
| 797 | ; | - |
| 798 | | - |
| 799 | for_command: FOR WORD newline_list DO compound_list DONE | - |
| 800 | { | - |
| 801 | $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); | - |
| 802 | if (word_top > 0) word_top--;executed 1 time by 1 test: word_top--; | TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 803 | } | - |
| 804 | | FOR WORD newline_list '{' compound_list '}' | - |
| 805 | { | - |
| 806 | $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); | - |
| 807 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 808 | } | - |
| 809 | | FOR WORD ';' newline_list DO compound_list DONE | - |
| 810 | { | - |
| 811 | $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); | - |
| 812 | if (word_top > 0) word_top--;executed 1 time by 1 test: word_top--; | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1 |
| 813 | } | - |
| 814 | | FOR WORD ';' newline_list '{' compound_list '}' | - |
| 815 | { | - |
| 816 | $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); | - |
| 817 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 818 | } | - |
| 819 | | FOR WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE | - |
| 820 | { | - |
| 821 | $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); | - |
| 822 | if (word_top > 0) word_top--;executed 23112 times by 1 test: word_top--; | TRUE | evaluated 23112 times by 1 test | | FALSE | evaluated 2337 times by 1 test |
| 2337-23112 |
| 823 | } | - |
| 824 | | FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}' | - |
| 825 | { | - |
| 826 | $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); | - |
| 827 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 828 | } | - |
| 829 | | FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE | - |
| 830 | { | - |
| 831 | $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); | - |
| 832 | if (word_top > 0) word_top--;executed 128 times by 1 test: word_top--; | TRUE | evaluated 128 times by 1 test | | FALSE | evaluated 72 times by 1 test |
| 72-128 |
| 833 | } | - |
| 834 | | FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}' | - |
| 835 | { | - |
| 836 | $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); | - |
| 837 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 838 | } | - |
| 839 | ; | - |
| 840 | | - |
| 841 | arith_for_command: FOR ARITH_FOR_EXPRS list_terminator newline_list DO compound_list DONE | - |
| 842 | { | - |
| 843 | $$ = make_arith_for_command ($2, $6, arith_for_lineno); | - |
| 844 | if ($$ == 0) YYERROR;executed 2 times by 1 test: goto yyerrorlab; | TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 2237 times by 1 test |
| 2-2237 |
| 845 | if (word_top > 0) word_top--;executed 4 times by 1 test: word_top--; | TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 2233 times by 1 test |
| 4-2233 |
| 846 | } | - |
| 847 | | FOR ARITH_FOR_EXPRS list_terminator newline_list '{' compound_list '}' | - |
| 848 | { | - |
| 849 | $$ = make_arith_for_command ($2, $6, arith_for_lineno); | - |
| 850 | if ($$ == 0) YYERROR; never executed: goto yyerrorlab; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 851 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 852 | } | - |
| 853 | | FOR ARITH_FOR_EXPRS DO compound_list DONE | - |
| 854 | { | - |
| 855 | $$ = make_arith_for_command ($2, $4, arith_for_lineno); | - |
| 856 | if ($$ == 0) YYERROR; never executed: goto yyerrorlab; | TRUE | never evaluated | | FALSE | evaluated 201 times by 1 test |
| 0-201 |
| 857 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | evaluated 201 times by 1 test |
| 0-201 |
| 858 | } | - |
| 859 | | FOR ARITH_FOR_EXPRS '{' compound_list '}' | - |
| 860 | { | - |
| 861 | $$ = make_arith_for_command ($2, $4, arith_for_lineno); | - |
| 862 | if ($$ == 0) YYERROR; never executed: goto yyerrorlab; | TRUE | never evaluated | | FALSE | evaluated 201 times by 1 test |
| 0-201 |
| 863 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | evaluated 201 times by 1 test |
| 0-201 |
| 864 | } | - |
| 865 | ; | - |
| 866 | | - |
| 867 | select_command: SELECT WORD newline_list DO list DONE | - |
| 868 | { | - |
| 869 | $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); | - |
| 870 | if (word_top > 0) word_top--;executed 1 time by 1 test: word_top--; | TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 871 | } | - |
| 872 | | SELECT WORD newline_list '{' list '}' | - |
| 873 | { | - |
| 874 | $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); | - |
| 875 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 876 | } | - |
| 877 | | SELECT WORD ';' newline_list DO list DONE | - |
| 878 | { | - |
| 879 | $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); | - |
| 880 | if (word_top > 0) word_top--;executed 2 times by 1 test: word_top--; | TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 881 | } | - |
| 882 | | SELECT WORD ';' newline_list '{' list '}' | - |
| 883 | { | - |
| 884 | $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); | - |
| 885 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 886 | } | - |
| 887 | | SELECT WORD newline_list IN word_list list_terminator newline_list DO list DONE | - |
| 888 | { | - |
| 889 | $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); | - |
| 890 | if (word_top > 0) word_top--;executed 6 times by 1 test: word_top--; | TRUE | evaluated 6 times by 1 test | | FALSE | never evaluated |
| 0-6 |
| 891 | } | - |
| 892 | | SELECT WORD newline_list IN word_list list_terminator newline_list '{' list '}' | - |
| 893 | { | - |
| 894 | $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); | - |
| 895 | if (word_top > 0) word_top--; never executed: word_top--; | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 896 | } | - |
| 897 | ; | - |
| 898 | | - |
| 899 | case_command: CASE WORD newline_list IN newline_list ESAC | - |
| 900 | { | - |
| 901 | $$ = make_case_command ($2, (PATTERN_LIST *)NULL, word_lineno[word_top]); | - |
| 902 | if (word_top > 0) word_top--;executed 1 time by 1 test: word_top--; | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1 |
| 903 | } | - |
| 904 | | CASE WORD newline_list IN case_clause_sequence newline_list ESAC | - |
| 905 | { | - |
| 906 | $$ = make_case_command ($2, $5, word_lineno[word_top]); | - |
| 907 | if (word_top > 0) word_top--;executed 75309 times by 1 test: word_top--; | TRUE | evaluated 75309 times by 1 test | | FALSE | evaluated 292 times by 1 test |
| 292-75309 |
| 908 | } | - |
| 909 | | CASE WORD newline_list IN case_clause ESAC | - |
| 910 | { | - |
| 911 | $$ = make_case_command ($2, $5, word_lineno[word_top]); | - |
| 912 | if (word_top > 0) word_top--;executed 2450 times by 1 test: word_top--; | TRUE | evaluated 2450 times by 1 test | | FALSE | evaluated 57 times by 1 test |
| 57-2450 |
| 913 | } | - |
| 914 | ; | - |
| 915 | | - |
| 916 | function_def: WORD '(' ')' newline_list function_body | - |
| 917 | { $$ = make_function_def ($1, $5, function_dstart, function_bstart); } | - |
| 918 | | - |
| 919 | | FUNCTION WORD '(' ')' newline_list function_body | - |
| 920 | { $$ = make_function_def ($2, $6, function_dstart, function_bstart); } | - |
| 921 | | - |
| 922 | | FUNCTION WORD newline_list function_body | - |
| 923 | { $$ = make_function_def ($2, $4, function_dstart, function_bstart); } | - |
| 924 | ; | - |
| 925 | | - |
| 926 | function_body: shell_command | - |
| 927 | { $$ = $1; } | - |
| 928 | | shell_command redirection_list | - |
| 929 | { | - |
| 930 | COMMAND *tc; | - |
| 931 | | - |
| 932 | tc = $1; | - |
| 933 | | - |
| 934 | | - |
| 935 | | - |
| 936 | | - |
| 937 | | - |
| 938 | | - |
| 939 | | - |
| 940 | | - |
| 941 | | - |
| 942 | | - |
| 943 | | - |
| 944 | | - |
| 945 | | - |
| 946 | if (tc && tc->redirects)| TRUE | evaluated 31 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 31 times by 1 test |
| 0-31 |
| 947 | { | - |
| 948 | register REDIRECT *t; | - |
| 949 | for (t = tc->redirects; t->next; t = t->next)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 950 | ; never executed: ; | 0 |
| 951 | t->next = $2; | - |
| 952 | } never executed: end of block | 0 |
| 953 | else if (tc)| TRUE | evaluated 31 times by 1 test | | FALSE | never evaluated |
| 0-31 |
| 954 | tc->redirects = $2;executed 31 times by 1 test: tc->redirects = (yyvsp[0].redirect); | 31 |
| 955 | $$ = $1; | - |
| 956 | } | - |
| 957 | ; | - |
| 958 | | - |
| 959 | subshell: '(' compound_list ')' | - |
| 960 | { | - |
| 961 | $$ = make_subshell_command ($2); | - |
| 962 | $$->flags |= CMD_WANT_SUBSHELL; | - |
| 963 | } | - |
| 964 | ; | - |
| 965 | | - |
| 966 | coproc: COPROC shell_command | - |
| 967 | { | - |
| 968 | $$ = make_coproc_command ("COPROC", $2); | - |
| 969 | $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; | - |
| 970 | } | - |
| 971 | | COPROC shell_command redirection_list | - |
| 972 | { | - |
| 973 | COMMAND *tc; | - |
| 974 | | - |
| 975 | tc = $2; | - |
| 976 | if (tc && tc->redirects)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 977 | { | - |
| 978 | register REDIRECT *t; | - |
| 979 | for (t = tc->redirects; t->next; t = t->next)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 980 | ; never executed: ; | 0 |
| 981 | t->next = $3; | - |
| 982 | } never executed: end of block | 0 |
| 983 | else if (tc)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 984 | tc->redirects = $3; never executed: tc->redirects = (yyvsp[0].redirect); | 0 |
| 985 | $$ = make_coproc_command ("COPROC", $2); | - |
| 986 | $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; | - |
| 987 | } | - |
| 988 | | COPROC WORD shell_command | - |
| 989 | { | - |
| 990 | $$ = make_coproc_command ($2->word, $3); | - |
| 991 | $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; | - |
| 992 | } | - |
| 993 | | COPROC WORD shell_command redirection_list | - |
| 994 | { | - |
| 995 | COMMAND *tc; | - |
| 996 | | - |
| 997 | tc = $3; | - |
| 998 | if (tc && tc->redirects)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 999 | { | - |
| 1000 | register REDIRECT *t; | - |
| 1001 | for (t = tc->redirects; t->next; t = t->next)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1002 | ; never executed: ; | 0 |
| 1003 | t->next = $4; | - |
| 1004 | } never executed: end of block | 0 |
| 1005 | else if (tc)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1006 | tc->redirects = $4; never executed: tc->redirects = (yyvsp[0].redirect); | 0 |
| 1007 | $$ = make_coproc_command ($2->word, $3); | - |
| 1008 | $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; | - |
| 1009 | } | - |
| 1010 | | COPROC simple_command | - |
| 1011 | { | - |
| 1012 | $$ = make_coproc_command ("COPROC", clean_simple_command ($2)); | - |
| 1013 | $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; | - |
| 1014 | } | - |
| 1015 | ; | - |
| 1016 | | - |
| 1017 | if_command: IF compound_list THEN compound_list FI | - |
| 1018 | { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } | - |
| 1019 | | IF compound_list THEN compound_list ELSE compound_list FI | - |
| 1020 | { $$ = make_if_command ($2, $4, $6); } | - |
| 1021 | | IF compound_list THEN compound_list elif_clause FI | - |
| 1022 | { $$ = make_if_command ($2, $4, $5); } | - |
| 1023 | ; | - |
| 1024 | | - |
| 1025 | | - |
| 1026 | group_command: '{' compound_list '}' | - |
| 1027 | { $$ = make_group_command ($2); } | - |
| 1028 | ; | - |
| 1029 | | - |
| 1030 | arith_command: ARITH_CMD | - |
| 1031 | { $$ = make_arith_command ($1); } | - |
| 1032 | ; | - |
| 1033 | | - |
| 1034 | cond_command: COND_START COND_CMD COND_END | - |
| 1035 | { $$ = $2; } | - |
| 1036 | ; | - |
| 1037 | | - |
| 1038 | elif_clause: ELIF compound_list THEN compound_list | - |
| 1039 | { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } | - |
| 1040 | | ELIF compound_list THEN compound_list ELSE compound_list | - |
| 1041 | { $$ = make_if_command ($2, $4, $6); } | - |
| 1042 | | ELIF compound_list THEN compound_list elif_clause | - |
| 1043 | { $$ = make_if_command ($2, $4, $5); } | - |
| 1044 | ; | - |
| 1045 | | - |
| 1046 | case_clause: pattern_list | - |
| 1047 | | case_clause_sequence pattern_list | - |
| 1048 | { $2->next = $1; $$ = $2; } | - |
| 1049 | ; | - |
| 1050 | | - |
| 1051 | pattern_list: newline_list pattern ')' compound_list | - |
| 1052 | { $$ = make_pattern_list ($2, $4); } | - |
| 1053 | | newline_list pattern ')' newline_list | - |
| 1054 | { $$ = make_pattern_list ($2, (COMMAND *)NULL); } | - |
| 1055 | | newline_list '(' pattern ')' compound_list | - |
| 1056 | { $$ = make_pattern_list ($3, $5); } | - |
| 1057 | | newline_list '(' pattern ')' newline_list | - |
| 1058 | { $$ = make_pattern_list ($3, (COMMAND *)NULL); } | - |
| 1059 | ; | - |
| 1060 | | - |
| 1061 | case_clause_sequence: pattern_list SEMI_SEMI | - |
| 1062 | { $$ = $1; } | - |
| 1063 | | case_clause_sequence pattern_list SEMI_SEMI | - |
| 1064 | { $2->next = $1; $$ = $2; } | - |
| 1065 | | pattern_list SEMI_AND | - |
| 1066 | { $1->flags |= CASEPAT_FALLTHROUGH; $$ = $1; } | - |
| 1067 | | case_clause_sequence pattern_list SEMI_AND | - |
| 1068 | { $2->flags |= CASEPAT_FALLTHROUGH; $2->next = $1; $$ = $2; } | - |
| 1069 | | pattern_list SEMI_SEMI_AND | - |
| 1070 | { $1->flags |= CASEPAT_TESTNEXT; $$ = $1; } | - |
| 1071 | | case_clause_sequence pattern_list SEMI_SEMI_AND | - |
| 1072 | { $2->flags |= CASEPAT_TESTNEXT; $2->next = $1; $$ = $2; } | - |
| 1073 | ; | - |
| 1074 | | - |
| 1075 | pattern: WORD | - |
| 1076 | { $$ = make_word_list ($1, (WORD_LIST *)NULL); } | - |
| 1077 | | pattern '|' WORD | - |
| 1078 | { $$ = make_word_list ($3, $1); } | - |
| 1079 | ; | - |
| 1080 | | - |
| 1081 | | - |
| 1082 | | - |
| 1083 | | - |
| 1084 | | - |
| 1085 | | - |
| 1086 | list: newline_list list0 | - |
| 1087 | { | - |
| 1088 | $$ = $2; | - |
| 1089 | if (need_here_doc)| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 95383 times by 1 test |
| 2-95383 |
| 1090 | gather_here_documents ();executed 2 times by 1 test: gather_here_documents (); | 2 |
| 1091 | } | - |
| 1092 | ; | - |
| 1093 | | - |
| 1094 | compound_list: list | - |
| 1095 | | newline_list list1 | - |
| 1096 | { | - |
| 1097 | $$ = $2; | - |
| 1098 | } | - |
| 1099 | ; | - |
| 1100 | | - |
| 1101 | list0: list1 '\n' newline_list | - |
| 1102 | | list1 '&' newline_list | - |
| 1103 | { | - |
| 1104 | if ($1->type == cm_connection)| TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 24 times by 1 test |
| 14-24 |
| 1105 | $$ = connect_async_list ($1, (COMMAND *)NULL, '&');executed 14 times by 1 test: (yyval.command) = connect_async_list ((yyvsp[-2].command), (COMMAND *) ((void *)0) , '&'); | 14 |
| 1106 | else | - |
| 1107 | $$ = command_connect ($1, (COMMAND *)NULL, '&');executed 24 times by 1 test: (yyval.command) = command_connect ((yyvsp[-2].command), (COMMAND *) ((void *)0) , '&'); | 24 |
| 1108 | } | - |
| 1109 | | list1 ';' newline_list | - |
| 1110 | | - |
| 1111 | ; | - |
| 1112 | | - |
| 1113 | list1: list1 AND_AND newline_list list1 | - |
| 1114 | { $$ = command_connect ($1, $4, AND_AND); } | - |
| 1115 | | list1 OR_OR newline_list list1 | - |
| 1116 | { $$ = command_connect ($1, $4, OR_OR); } | - |
| 1117 | | list1 '&' newline_list list1 | - |
| 1118 | { | - |
| 1119 | if ($1->type == cm_connection)| TRUE | evaluated 39 times by 1 test | | FALSE | evaluated 92 times by 1 test |
| 39-92 |
| 1120 | $$ = connect_async_list ($1, $4, '&');executed 39 times by 1 test: (yyval.command) = connect_async_list ((yyvsp[-3].command), (yyvsp[0].command), '&'); | 39 |
| 1121 | else | - |
| 1122 | $$ = command_connect ($1, $4, '&');executed 92 times by 1 test: (yyval.command) = command_connect ((yyvsp[-3].command), (yyvsp[0].command), '&'); | 92 |
| 1123 | } | - |
| 1124 | | list1 ';' newline_list list1 | - |
| 1125 | { $$ = command_connect ($1, $4, ';'); } | - |
| 1126 | | list1 '\n' newline_list list1 | - |
| 1127 | { $$ = command_connect ($1, $4, ';'); } | - |
| 1128 | | pipeline_command | - |
| 1129 | { $$ = $1; } | - |
| 1130 | ; | - |
| 1131 | | - |
| 1132 | simple_list_terminator: '\n' | - |
| 1133 | | yacc_EOF | - |
| 1134 | ; | - |
| 1135 | | - |
| 1136 | list_terminator:'\n' | - |
| 1137 | { $$ = '\n'; } | - |
| 1138 | | ';' | - |
| 1139 | { $$ = ';'; } | - |
| 1140 | | yacc_EOF | - |
| 1141 | { $$ = yacc_EOF; } | - |
| 1142 | ; | - |
| 1143 | | - |
| 1144 | newline_list: | - |
| 1145 | | newline_list '\n' | - |
| 1146 | ; | - |
| 1147 | | - |
| 1148 | | - |
| 1149 | | - |
| 1150 | | - |
| 1151 | | - |
| 1152 | | - |
| 1153 | | - |
| 1154 | simple_list: simple_list1 | - |
| 1155 | { | - |
| 1156 | $$ = $1; | - |
| 1157 | if (need_here_doc)| TRUE | never evaluated | | FALSE | evaluated 824352 times by 1 test |
| 0-824352 |
| 1158 | gather_here_documents (); never executed: gather_here_documents (); | 0 |
| 1159 | if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token)| TRUE | evaluated 705161 times by 1 test | | FALSE | evaluated 119191 times by 1 test |
| TRUE | evaluated 704323 times by 1 test | | FALSE | evaluated 838 times by 1 test |
| 838-705161 |
| 1160 | { | - |
| 1161 | global_command = $1; | - |
| 1162 | eof_encountered = 0; | - |
| 1163 | rewind_input_string (); | - |
| 1164 | YYACCEPT;executed 704323 times by 1 test: goto yyacceptlab; | 704323 |
| 1165 | } | - |
| 1166 | } | - |
| 1167 | | simple_list1 '&' | - |
| 1168 | { | - |
| 1169 | if ($1->type == cm_connection)| TRUE | evaluated 9 times by 1 test | | FALSE | evaluated 115 times by 1 test |
| 9-115 |
| 1170 | $$ = connect_async_list ($1, (COMMAND *)NULL, '&');executed 9 times by 1 test: (yyval.command) = connect_async_list ((yyvsp[-1].command), (COMMAND *) ((void *)0) , '&'); | 9 |
| 1171 | else | - |
| 1172 | $$ = command_connect ($1, (COMMAND *)NULL, '&');executed 115 times by 1 test: (yyval.command) = command_connect ((yyvsp[-1].command), (COMMAND *) ((void *)0) , '&'); | 115 |
| 1173 | if (need_here_doc)| TRUE | never evaluated | | FALSE | evaluated 124 times by 1 test |
| 0-124 |
| 1174 | gather_here_documents (); never executed: gather_here_documents (); | 0 |
| 1175 | if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token)| TRUE | never evaluated | | FALSE | evaluated 124 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-124 |
| 1176 | { | - |
| 1177 | global_command = $1; | - |
| 1178 | eof_encountered = 0; | - |
| 1179 | rewind_input_string (); | - |
| 1180 | YYACCEPT; never executed: goto yyacceptlab; | 0 |
| 1181 | } | - |
| 1182 | } | - |
| 1183 | | simple_list1 ';' | - |
| 1184 | { | - |
| 1185 | $$ = $1; | - |
| 1186 | if (need_here_doc)| TRUE | never evaluated | | FALSE | evaluated 49 times by 1 test |
| 0-49 |
| 1187 | gather_here_documents (); never executed: gather_here_documents (); | 0 |
| 1188 | if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token)| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 44 times by 1 test |
| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
| 0-44 |
| 1189 | { | - |
| 1190 | global_command = $1; | - |
| 1191 | eof_encountered = 0; | - |
| 1192 | rewind_input_string (); | - |
| 1193 | YYACCEPT;executed 5 times by 1 test: goto yyacceptlab; | 5 |
| 1194 | } | - |
| 1195 | } | - |
| 1196 | ; | - |
| 1197 | | - |
| 1198 | simple_list1: simple_list1 AND_AND newline_list simple_list1 | - |
| 1199 | { $$ = command_connect ($1, $4, AND_AND); } | - |
| 1200 | | simple_list1 OR_OR newline_list simple_list1 | - |
| 1201 | { $$ = command_connect ($1, $4, OR_OR); } | - |
| 1202 | | simple_list1 '&' simple_list1 | - |
| 1203 | { | - |
| 1204 | if ($1->type == cm_connection)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 15 times by 1 test |
| 1-15 |
| 1205 | $$ = connect_async_list ($1, $3, '&');executed 1 time by 1 test: (yyval.command) = connect_async_list ((yyvsp[-2].command), (yyvsp[0].command), '&'); | 1 |
| 1206 | else | - |
| 1207 | $$ = command_connect ($1, $3, '&');executed 15 times by 1 test: (yyval.command) = command_connect ((yyvsp[-2].command), (yyvsp[0].command), '&'); | 15 |
| 1208 | } | - |
| 1209 | | simple_list1 ';' simple_list1 | - |
| 1210 | { $$ = command_connect ($1, $3, ';'); } | - |
| 1211 | | - |
| 1212 | | pipeline_command | - |
| 1213 | { $$ = $1; } | - |
| 1214 | ; | - |
| 1215 | | - |
| 1216 | pipeline_command: pipeline | - |
| 1217 | { $$ = $1; } | - |
| 1218 | | BANG pipeline_command | - |
| 1219 | { | - |
| 1220 | if ($2)| TRUE | evaluated 290 times by 1 test | | FALSE | never evaluated |
| 0-290 |
| 1221 | $2->flags ^= CMD_INVERT_RETURN; executed 290 times by 1 test: (yyvsp[0].command)->flags ^= 0x04; | 290 |
| 1222 | $$ = $2; | - |
| 1223 | } | - |
| 1224 | | timespec pipeline_command | - |
| 1225 | { | - |
| 1226 | if ($2)| TRUE | evaluated 14 times by 1 test | | FALSE | never evaluated |
| 0-14 |
| 1227 | $2->flags |= $1;executed 14 times by 1 test: (yyvsp[0].command)->flags |= (yyvsp[-1].number); | 14 |
| 1228 | $$ = $2; | - |
| 1229 | } | - |
| 1230 | | timespec list_terminator | - |
| 1231 | { | - |
| 1232 | ELEMENT x; | - |
| 1233 | | - |
| 1234 | | - |
| 1235 | | - |
| 1236 | | - |
| 1237 | | - |
| 1238 | | - |
| 1239 | x.word = 0; | - |
| 1240 | x.redirect = 0; | - |
| 1241 | $$ = make_simple_command (x, (COMMAND *)NULL); | - |
| 1242 | $$->flags |= $1; | - |
| 1243 | | - |
| 1244 | if ($2 == '\n')| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 1245 | token_to_read = '\n';executed 1 time by 1 test: token_to_read = '\n'; | 1 |
| 1246 | else if ($2 == ';')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1247 | token_to_read = ';'; never executed: token_to_read = ';'; | 0 |
| 1248 | parser_state &= ~PST_REDIRLIST; | - |
| 1249 | } | - |
| 1250 | | BANG list_terminator | - |
| 1251 | { | - |
| 1252 | ELEMENT x; | - |
| 1253 | | - |
| 1254 | | - |
| 1255 | | - |
| 1256 | | - |
| 1257 | | - |
| 1258 | | - |
| 1259 | | - |
| 1260 | x.word = 0; | - |
| 1261 | x.redirect = 0; | - |
| 1262 | $$ = make_simple_command (x, (COMMAND *)NULL); | - |
| 1263 | $$->flags |= CMD_INVERT_RETURN; | - |
| 1264 | | - |
| 1265 | if ($2 == '\n')| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-4 |
| 1266 | token_to_read = '\n';executed 4 times by 1 test: token_to_read = '\n'; | 4 |
| 1267 | if ($2 == ';')| TRUE | never evaluated | | FALSE | evaluated 4 times by 1 test |
| 0-4 |
| 1268 | token_to_read = ';'; never executed: token_to_read = ';'; | 0 |
| 1269 | parser_state &= ~PST_REDIRLIST; | - |
| 1270 | } | - |
| 1271 | ; | - |
| 1272 | | - |
| 1273 | pipeline: pipeline '|' newline_list pipeline | - |
| 1274 | { $$ = command_connect ($1, $4, '|'); } | - |
| 1275 | | pipeline BAR_AND newline_list pipeline | - |
| 1276 | { | - |
| 1277 | | - |
| 1278 | COMMAND *tc; | - |
| 1279 | REDIRECTEE rd, sd; | - |
| 1280 | REDIRECT *r; | - |
| 1281 | | - |
| 1282 | tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1;| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 1283 | sd.dest = 2; | - |
| 1284 | rd.dest = 1; | - |
| 1285 | r = make_redirection (sd, r_duplicating_output, rd, 0); | - |
| 1286 | if (tc->redirects)| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 1287 | { | - |
| 1288 | register REDIRECT *t; | - |
| 1289 | for (t = tc->redirects; t->next; t = t->next)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1290 | ; never executed: ; | 0 |
| 1291 | t->next = r; | - |
| 1292 | } never executed: end of block | 0 |
| 1293 | else | - |
| 1294 | tc->redirects = r;executed 2 times by 1 test: tc->redirects = r; | 2 |
| 1295 | | - |
| 1296 | $$ = command_connect ($1, $4, '|'); | - |
| 1297 | } | - |
| 1298 | | command | - |
| 1299 | { $$ = $1; } | - |
| 1300 | ; | - |
| 1301 | | - |
| 1302 | timespec: TIME | - |
| 1303 | { $$ = CMD_TIME_PIPELINE; } | - |
| 1304 | | TIME TIMEOPT | - |
| 1305 | { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } | - |
| 1306 | | TIME TIMEOPT TIMEIGN | - |
| 1307 | { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } | - |
| 1308 | ; | - |
| 1309 | %% | - |
| 1310 | | - |
| 1311 | | - |
| 1312 | | - |
| 1313 | #define TOKEN_DEFAULT_INITIAL_SIZE 496 | - |
| 1314 | #define TOKEN_DEFAULT_GROW_SIZE 512 | - |
| 1315 | | - |
| 1316 | | - |
| 1317 | #define SHOULD_PROMPT() \ | - |
| 1318 | (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) | - |
| 1319 | | - |
| 1320 | #if defined (ALIAS) | - |
| 1321 | # define expanding_alias() (pushed_string_list && pushed_string_list->expander) | - |
| 1322 | #else | - |
| 1323 | # define expanding_alias() 0 | - |
| 1324 | #endif | - |
| 1325 | | - |
| 1326 | | - |
| 1327 | int EOF_Reached = 0; | - |
| 1328 | | - |
| 1329 | #ifdef DEBUG | - |
| 1330 | static void | - |
| 1331 | debug_parser (i) | - |
| 1332 | int i; | - |
| 1333 | { | - |
| 1334 | #if YYDEBUG != 0 | - |
| 1335 | yydebug = i; | - |
| 1336 | yyoutstream = stdout; | - |
| 1337 | yyerrstream = stderr; | - |
| 1338 | #endif | - |
| 1339 | } never executed: end of block | 0 |
| 1340 | #endif | - |
| 1341 | | - |
| 1342 | | - |
| 1343 | | - |
| 1344 | | - |
| 1345 | | - |
| 1346 | | - |
| 1347 | | - |
| 1348 | | - |
| 1349 | | - |
| 1350 | | - |
| 1351 | int | - |
| 1352 | return_EOF () | - |
| 1353 | { | - |
| 1354 | return (EOF); never executed: return ( (-1) ); | 0 |
| 1355 | } | - |
| 1356 | | - |
| 1357 | | - |
| 1358 | | - |
| 1359 | BASH_INPUT bash_input; | - |
| 1360 | | - |
| 1361 | | - |
| 1362 | | - |
| 1363 | void | - |
| 1364 | initialize_bash_input () | - |
| 1365 | { | - |
| 1366 | bash_input.type = st_none; | - |
| 1367 | FREE (bash_input.name);executed 15 times by 1 test: sh_xfree((bash_input.name), "./parse.y", 1367); | TRUE | evaluated 15 times by 1 test | | FALSE | evaluated 5432 times by 1 test |
| 15-5432 |
| 1368 | bash_input.name = (char *)NULL; | - |
| 1369 | bash_input.location.file = (FILE *)NULL; | - |
| 1370 | bash_input.location.string = (char *)NULL; | - |
| 1371 | bash_input.getter = (sh_cget_func_t *)NULL; | - |
| 1372 | bash_input.ungetter = (sh_cunget_func_t *)NULL; | - |
| 1373 | }executed 5447 times by 1 test: end of block | 5447 |
| 1374 | | - |
| 1375 | | - |
| 1376 | | - |
| 1377 | void | - |
| 1378 | init_yy_io (get, unget, type, name, location) | - |
| 1379 | sh_cget_func_t *get; | - |
| 1380 | sh_cunget_func_t *unget; | - |
| 1381 | enum stream_type type; | - |
| 1382 | const char *name; | - |
| 1383 | INPUT_STREAM location; | - |
| 1384 | { | - |
| 1385 | bash_input.type = type; | - |
| 1386 | FREE (bash_input.name);executed 725402 times by 1 test: sh_xfree((bash_input.name), "./parse.y", 1386); | TRUE | evaluated 725402 times by 1 test | | FALSE | evaluated 732379 times by 1 test |
| 725402-732379 |
| 1387 | bash_input.name = name ? savestring (name) : (char *)NULL;| TRUE | evaluated 1457539 times by 1 test | | FALSE | evaluated 242 times by 1 test |
| 242-1457539 |
| 1388 | | - |
| 1389 | | - |
| 1390 | #if defined (CRAY) | - |
| 1391 | memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); | - |
| 1392 | #else | - |
| 1393 | bash_input.location = location; | - |
| 1394 | #endif | - |
| 1395 | bash_input.getter = get; | - |
| 1396 | bash_input.ungetter = unget; | - |
| 1397 | }executed 1457781 times by 1 test: end of block | 1457781 |
| 1398 | | - |
| 1399 | char * | - |
| 1400 | yy_input_name () | - |
| 1401 | { | - |
| 1402 | return (bash_input.name ? bash_input.name : "stdin");executed 91 times by 1 test: return (bash_input.name ? bash_input.name : "stdin"); | 91 |
| 1403 | } | - |
| 1404 | | - |
| 1405 | | - |
| 1406 | static int | - |
| 1407 | yy_getc () | - |
| 1408 | { | - |
| 1409 | return (*(bash_input.getter)) ();executed 20807233 times by 1 test: return (*(bash_input.getter)) (); | 20807233 |
| 1410 | } | - |
| 1411 | | - |
| 1412 | | - |
| 1413 | | - |
| 1414 | static int | - |
| 1415 | yy_ungetc (c) | - |
| 1416 | int c; | - |
| 1417 | { | - |
| 1418 | return (*(bash_input.ungetter)) (c);executed 1161 times by 1 test: return (*(bash_input.ungetter)) (c); | 1161 |
| 1419 | } | - |
| 1420 | | - |
| 1421 | #if defined (BUFFERED_INPUT) | - |
| 1422 | #ifdef INCLUDE_UNUSED | - |
| 1423 | int | - |
| 1424 | input_file_descriptor () | - |
| 1425 | { | - |
| 1426 | switch (bash_input.type) | - |
| 1427 | { | - |
| 1428 | case st_stream: | - |
| 1429 | return (fileno (bash_input.location.file)); | - |
| 1430 | case st_bstream: | - |
| 1431 | return (bash_input.location.buffered_fd); | - |
| 1432 | case st_stdin: | - |
| 1433 | default: | - |
| 1434 | return (fileno (stdin)); | - |
| 1435 | } | - |
| 1436 | } | - |
| 1437 | #endif | - |
| 1438 | #endif /* BUFFERED_INPUT */ | - |
| 1439 | | - |
| 1440 | | - |
| 1441 | | - |
| 1442 | | - |
| 1443 | | - |
| 1444 | | - |
| 1445 | | - |
| 1446 | #if defined (READLINE) | - |
| 1447 | char *current_readline_prompt = (char *)NULL; | - |
| 1448 | char *current_readline_line = (char *)NULL; | - |
| 1449 | int current_readline_line_index = 0; | - |
| 1450 | | - |
| 1451 | static int | - |
| 1452 | yy_readline_get () | - |
| 1453 | { | - |
| 1454 | SigHandler *old_sigint; | - |
| 1455 | int line_len; | - |
| 1456 | unsigned char c; | - |
| 1457 | | - |
| 1458 | if (current_readline_line == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1459 | { | - |
| 1460 | if (bash_readline_initialized == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1461 | initialize_readline (); never executed: initialize_readline (); | 0 |
| 1462 | | - |
| 1463 | #if defined (JOB_CONTROL) | - |
| 1464 | if (job_control)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1465 | give_terminal_to (shell_pgrp, 0); never executed: give_terminal_to (shell_pgrp, 0); | 0 |
| 1466 | #endif /* JOB_CONTROL */ | - |
| 1467 | | - |
| 1468 | old_sigint = IMPOSSIBLE_TRAP_HANDLER; | - |
| 1469 | if (signal_is_ignored (SIGINT) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1470 | { | - |
| 1471 | | - |
| 1472 | old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); | - |
| 1473 | } never executed: end of block | 0 |
| 1474 | | - |
| 1475 | sh_unset_nodelay_mode (fileno (rl_instream)); | - |
| 1476 | current_readline_line = readline (current_readline_prompt ? | - |
| 1477 | current_readline_prompt : ""); | - |
| 1478 | | - |
| 1479 | CHECK_TERMSIG; never executed: termsig_handler (terminating_signal); | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1480 | if (signal_is_ignored (SIGINT) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1481 | { | - |
| 1482 | | - |
| 1483 | if (old_sigint != IMPOSSIBLE_TRAP_HANDLER)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1484 | set_signal_handler (SIGINT, old_sigint); never executed: set_signal_handler ( 2 , old_sigint); | 0 |
| 1485 | } never executed: end of block | 0 |
| 1486 | | - |
| 1487 | #if 0 | - |
| 1488 | | - |
| 1489 | reset_readline_prompt (); | - |
| 1490 | #endif | - |
| 1491 | | - |
| 1492 | if (current_readline_line == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1493 | return (EOF); never executed: return ( (-1) ); | 0 |
| 1494 | | - |
| 1495 | current_readline_line_index = 0; | - |
| 1496 | line_len = strlen (current_readline_line); | - |
| 1497 | | - |
| 1498 | current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); | - |
| 1499 | current_readline_line[line_len++] = '\n'; | - |
| 1500 | current_readline_line[line_len] = '\0'; | - |
| 1501 | } never executed: end of block | 0 |
| 1502 | | - |
| 1503 | if (current_readline_line[current_readline_line_index] == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1504 | { | - |
| 1505 | free (current_readline_line); | - |
| 1506 | current_readline_line = (char *)NULL; | - |
| 1507 | return (yy_readline_get ()); never executed: return (yy_readline_get ()); | 0 |
| 1508 | } | - |
| 1509 | else | - |
| 1510 | { | - |
| 1511 | c = current_readline_line[current_readline_line_index++]; | - |
| 1512 | return (c); never executed: return (c); | 0 |
| 1513 | } | - |
| 1514 | } | - |
| 1515 | | - |
| 1516 | static int | - |
| 1517 | yy_readline_unget (c) | - |
| 1518 | int c; | - |
| 1519 | { | - |
| 1520 | if (current_readline_line_index && current_readline_line)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1521 | current_readline_line[--current_readline_line_index] = c; never executed: current_readline_line[--current_readline_line_index] = c; | 0 |
| 1522 | return (c); never executed: return (c); | 0 |
| 1523 | } | - |
| 1524 | | - |
| 1525 | void | - |
| 1526 | with_input_from_stdin () | - |
| 1527 | { | - |
| 1528 | INPUT_STREAM location; | - |
| 1529 | | - |
| 1530 | if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1531 | { | - |
| 1532 | location.string = current_readline_line; | - |
| 1533 | init_yy_io (yy_readline_get, yy_readline_unget, | - |
| 1534 | st_stdin, "readline stdin", location); | - |
| 1535 | } never executed: end of block | 0 |
| 1536 | } never executed: end of block | 0 |
| 1537 | | - |
| 1538 | #else /* !READLINE */ | - |
| 1539 | | - |
| 1540 | void | - |
| 1541 | with_input_from_stdin () | - |
| 1542 | { | - |
| 1543 | with_input_from_stream (stdin, "stdin"); | - |
| 1544 | } | - |
| 1545 | #endif /* !READLINE */ | - |
| 1546 | | - |
| 1547 | | - |
| 1548 | | - |
| 1549 | | - |
| 1550 | | - |
| 1551 | | - |
| 1552 | | - |
| 1553 | static int | - |
| 1554 | yy_string_get () | - |
| 1555 | { | - |
| 1556 | register char *string; | - |
| 1557 | register unsigned char c; | - |
| 1558 | | - |
| 1559 | string = bash_input.location.string; | - |
| 1560 | | - |
| 1561 | | - |
| 1562 | if (string && *string)| TRUE | evaluated 7578364 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 6852790 times by 1 test | | FALSE | evaluated 725574 times by 1 test |
| 0-7578364 |
| 1563 | { | - |
| 1564 | c = *string++; | - |
| 1565 | bash_input.location.string = string; | - |
| 1566 | return (c);executed 6852790 times by 1 test: return (c); | 6852790 |
| 1567 | } | - |
| 1568 | else | - |
| 1569 | return (EOF);executed 725574 times by 1 test: return ( (-1) ); | 725574 |
| 1570 | } | - |
| 1571 | | - |
| 1572 | static int | - |
| 1573 | yy_string_unget (c) | - |
| 1574 | int c; | - |
| 1575 | { | - |
| 1576 | *(--bash_input.location.string) = c; | - |
| 1577 | return (c);executed 1 time by 1 test: return (c); | 1 |
| 1578 | } | - |
| 1579 | | - |
| 1580 | void | - |
| 1581 | with_input_from_string (string, name) | - |
| 1582 | char *string; | - |
| 1583 | const char *name; | - |
| 1584 | { | - |
| 1585 | INPUT_STREAM location; | - |
| 1586 | | - |
| 1587 | location.string = string; | - |
| 1588 | init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); | - |
| 1589 | }executed 727082 times by 1 test: end of block | 727082 |
| 1590 | | - |
| 1591 | | - |
| 1592 | | - |
| 1593 | | - |
| 1594 | | - |
| 1595 | | - |
| 1596 | static void | - |
| 1597 | rewind_input_string () | - |
| 1598 | { | - |
| 1599 | int xchars; | - |
| 1600 | | - |
| 1601 | | - |
| 1602 | | - |
| 1603 | xchars = shell_input_line_len - shell_input_line_index; | - |
| 1604 | if (bash_input.location.string[-1] == '\n')| TRUE | evaluated 119 times by 1 test | | FALSE | evaluated 705170 times by 1 test |
| 119-705170 |
| 1605 | xchars++;executed 119 times by 1 test: xchars++; | 119 |
| 1606 | | - |
| 1607 | | - |
| 1608 | | - |
| 1609 | | - |
| 1610 | | - |
| 1611 | | - |
| 1612 | | - |
| 1613 | | - |
| 1614 | | - |
| 1615 | bash_input.location.string -= xchars; | - |
| 1616 | }executed 705289 times by 1 test: end of block | 705289 |
| 1617 | | - |
| 1618 | | - |
| 1619 | | - |
| 1620 | | - |
| 1621 | | - |
| 1622 | | - |
| 1623 | | - |
| 1624 | | - |
| 1625 | | - |
| 1626 | | - |
| 1627 | | - |
| 1628 | | - |
| 1629 | | - |
| 1630 | static int | - |
| 1631 | yy_stream_get () | - |
| 1632 | { | - |
| 1633 | int result; | - |
| 1634 | | - |
| 1635 | result = EOF; | - |
| 1636 | if (bash_input.location.file)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1637 | { | - |
| 1638 | | - |
| 1639 | | - |
| 1640 | result = getc_with_restart (bash_input.location.file); | - |
| 1641 | } never executed: end of block | 0 |
| 1642 | return (result); never executed: return (result); | 0 |
| 1643 | } | - |
| 1644 | | - |
| 1645 | static int | - |
| 1646 | yy_stream_unget (c) | - |
| 1647 | int c; | - |
| 1648 | { | - |
| 1649 | return (ungetc_with_restart (c, bash_input.location.file)); never executed: return (ungetc_with_restart (c, bash_input.location.file)); | 0 |
| 1650 | } | - |
| 1651 | | - |
| 1652 | void | - |
| 1653 | with_input_from_stream (stream, name) | - |
| 1654 | FILE *stream; | - |
| 1655 | const char *name; | - |
| 1656 | { | - |
| 1657 | INPUT_STREAM location; | - |
| 1658 | | - |
| 1659 | location.file = stream; | - |
| 1660 | init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); | - |
| 1661 | } never executed: end of block | 0 |
| 1662 | | - |
| 1663 | typedef struct stream_saver { | - |
| 1664 | struct stream_saver *next; | - |
| 1665 | BASH_INPUT bash_input; | - |
| 1666 | int line; | - |
| 1667 | #if defined (BUFFERED_INPUT) | - |
| 1668 | BUFFERED_STREAM *bstream; | - |
| 1669 | #endif /* BUFFERED_INPUT */ | - |
| 1670 | } STREAM_SAVER; | - |
| 1671 | | - |
| 1672 | | - |
| 1673 | int line_number = 0; | - |
| 1674 | | - |
| 1675 | | - |
| 1676 | int line_number_base = 0; | - |
| 1677 | | - |
| 1678 | #if defined (COND_COMMAND) | - |
| 1679 | static int cond_lineno; | - |
| 1680 | static int cond_token; | - |
| 1681 | #endif | - |
| 1682 | | - |
| 1683 | STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; | - |
| 1684 | | - |
| 1685 | void | - |
| 1686 | push_stream (reset_lineno) | - |
| 1687 | int reset_lineno; | - |
| 1688 | { | - |
| 1689 | STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); | - |
| 1690 | | - |
| 1691 | xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); | - |
| 1692 | | - |
| 1693 | #if defined (BUFFERED_INPUT) | - |
| 1694 | saver->bstream = (BUFFERED_STREAM *)NULL; | - |
| 1695 | | - |
| 1696 | if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0)| TRUE | evaluated 716135 times by 1 test | | FALSE | evaluated 10947 times by 1 test |
| TRUE | evaluated 716135 times by 1 test | | FALSE | never evaluated |
| 0-716135 |
| 1697 | saver->bstream = set_buffered_stream (bash_input.location.buffered_fd,executed 716135 times by 1 test: saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, (BUFFERED_STREAM *) ((void *)0) ); | 716135 |
| 1698 | (BUFFERED_STREAM *)NULL);executed 716135 times by 1 test: saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, (BUFFERED_STREAM *) ((void *)0) ); | 716135 |
| 1699 | #endif /* BUFFERED_INPUT */ | - |
| 1700 | | - |
| 1701 | saver->line = line_number; | - |
| 1702 | bash_input.name = (char *)NULL; | - |
| 1703 | saver->next = stream_list; | - |
| 1704 | stream_list = saver; | - |
| 1705 | EOF_Reached = 0; | - |
| 1706 | if (reset_lineno)| TRUE | evaluated 1913 times by 1 test | | FALSE | evaluated 725169 times by 1 test |
| 1913-725169 |
| 1707 | line_number = 0;executed 1913 times by 1 test: line_number = 0; | 1913 |
| 1708 | }executed 727082 times by 1 test: end of block | 727082 |
| 1709 | | - |
| 1710 | void | - |
| 1711 | pop_stream () | - |
| 1712 | { | - |
| 1713 | if (!stream_list)| TRUE | never evaluated | | FALSE | evaluated 725433 times by 1 test |
| 0-725433 |
| 1714 | EOF_Reached = 1; never executed: EOF_Reached = 1; | 0 |
| 1715 | else | - |
| 1716 | { | - |
| 1717 | STREAM_SAVER *saver = stream_list; | - |
| 1718 | | - |
| 1719 | EOF_Reached = 0; | - |
| 1720 | stream_list = stream_list->next; | - |
| 1721 | | - |
| 1722 | init_yy_io (saver->bash_input.getter, | - |
| 1723 | saver->bash_input.ungetter, | - |
| 1724 | saver->bash_input.type, | - |
| 1725 | saver->bash_input.name, | - |
| 1726 | saver->bash_input.location); | - |
| 1727 | | - |
| 1728 | #if defined (BUFFERED_INPUT) | - |
| 1729 | | - |
| 1730 | | - |
| 1731 | | - |
| 1732 | | - |
| 1733 | if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0)| TRUE | evaluated 716122 times by 1 test | | FALSE | evaluated 9311 times by 1 test |
| TRUE | evaluated 716122 times by 1 test | | FALSE | never evaluated |
| 0-716122 |
| 1734 | { | - |
| 1735 | if (bash_input_fd_changed)| TRUE | never evaluated | | FALSE | evaluated 716122 times by 1 test |
| 0-716122 |
| 1736 | { | - |
| 1737 | bash_input_fd_changed = 0; | - |
| 1738 | if (default_buffered_input >= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1739 | { | - |
| 1740 | bash_input.location.buffered_fd = default_buffered_input; | - |
| 1741 | saver->bstream->b_fd = default_buffered_input; | - |
| 1742 | SET_CLOSE_ON_EXEC (default_buffered_input); | - |
| 1743 | } never executed: end of block | 0 |
| 1744 | } never executed: end of block | 0 |
| 1745 | | - |
| 1746 | set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); | - |
| 1747 | }executed 716122 times by 1 test: end of block | 716122 |
| 1748 | #endif /* BUFFERED_INPUT */ | - |
| 1749 | | - |
| 1750 | line_number = saver->line; | - |
| 1751 | | - |
| 1752 | FREE (saver->bash_input.name);executed 725222 times by 1 test: sh_xfree((saver->bash_input.name), "./parse.y", 1752); | TRUE | evaluated 725222 times by 1 test | | FALSE | evaluated 211 times by 1 test |
| 211-725222 |
| 1753 | free (saver); | - |
| 1754 | }executed 725433 times by 1 test: end of block | 725433 |
| 1755 | } | - |
| 1756 | | - |
| 1757 | | - |
| 1758 | int | - |
| 1759 | stream_on_stack (type) | - |
| 1760 | enum stream_type type; | - |
| 1761 | { | - |
| 1762 | register STREAM_SAVER *s; | - |
| 1763 | | - |
| 1764 | for (s = stream_list; s; s = s->next)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1765 | if (s->bash_input.type == type)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 1766 | return 1; never executed: return 1; | 0 |
| 1767 | return 0; never executed: return 0; | 0 |
| 1768 | } | - |
| 1769 | | - |
| 1770 | | - |
| 1771 | int * | - |
| 1772 | save_token_state () | - |
| 1773 | { | - |
| 1774 | int *ret; | - |
| 1775 | | - |
| 1776 | ret = (int *)xmalloc (4 * sizeof (int)); | - |
| 1777 | ret[0] = last_read_token; | - |
| 1778 | ret[1] = token_before_that; | - |
| 1779 | ret[2] = two_tokens_ago; | - |
| 1780 | ret[3] = current_token; | - |
| 1781 | return ret;executed 707380 times by 1 test: return ret; | 707380 |
| 1782 | } | - |
| 1783 | | - |
| 1784 | void | - |
| 1785 | restore_token_state (ts) | - |
| 1786 | int *ts; | - |
| 1787 | { | - |
| 1788 | if (ts == 0)| TRUE | never evaluated | | FALSE | evaluated 707380 times by 1 test |
| 0-707380 |
| 1789 | return; never executed: return; | 0 |
| 1790 | last_read_token = ts[0]; | - |
| 1791 | token_before_that = ts[1]; | - |
| 1792 | two_tokens_ago = ts[2]; | - |
| 1793 | current_token = ts[3]; | - |
| 1794 | }executed 707380 times by 1 test: end of block | 707380 |
| 1795 | | - |
| 1796 | | - |
| 1797 | | - |
| 1798 | | - |
| 1799 | | - |
| 1800 | | - |
| 1801 | | - |
| 1802 | | - |
| 1803 | | - |
| 1804 | | - |
| 1805 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 1806 | | - |
| 1807 | #define END_OF_ALIAS 0 | - |
| 1808 | | - |
| 1809 | | - |
| 1810 | | - |
| 1811 | | - |
| 1812 | | - |
| 1813 | | - |
| 1814 | | - |
| 1815 | | - |
| 1816 | | - |
| 1817 | | - |
| 1818 | #define PSH_ALIAS 0x01 | - |
| 1819 | #define PSH_DPAREN 0x02 | - |
| 1820 | #define PSH_SOURCE 0x04 | - |
| 1821 | | - |
| 1822 | typedef struct string_saver { | - |
| 1823 | struct string_saver *next; | - |
| 1824 | int expand_alias; | - |
| 1825 | char *saved_line; | - |
| 1826 | #if defined (ALIAS) | - |
| 1827 | alias_t *expander; | - |
| 1828 | #endif | - |
| 1829 | size_t saved_line_size, saved_line_index; | - |
| 1830 | int saved_line_terminator; | - |
| 1831 | int flags; | - |
| 1832 | } STRING_SAVER; | - |
| 1833 | | - |
| 1834 | STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; | - |
| 1835 | | - |
| 1836 | | - |
| 1837 | | - |
| 1838 | | - |
| 1839 | | - |
| 1840 | | - |
| 1841 | | - |
| 1842 | | - |
| 1843 | | - |
| 1844 | static void | - |
| 1845 | push_string (s, expand, ap) | - |
| 1846 | char *s; | - |
| 1847 | int expand; | - |
| 1848 | alias_t *ap; | - |
| 1849 | { | - |
| 1850 | STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); | - |
| 1851 | | - |
| 1852 | temp->expand_alias = expand; | - |
| 1853 | temp->saved_line = shell_input_line; | - |
| 1854 | temp->saved_line_size = shell_input_line_size; | - |
| 1855 | temp->saved_line_index = shell_input_line_index; | - |
| 1856 | temp->saved_line_terminator = shell_input_line_terminator; | - |
| 1857 | temp->flags = 0; | - |
| 1858 | #if defined (ALIAS) | - |
| 1859 | temp->expander = ap; | - |
| 1860 | if (ap)| TRUE | evaluated 82 times by 1 test | | FALSE | evaluated 38 times by 1 test |
| 38-82 |
| 1861 | temp->flags = PSH_ALIAS;executed 82 times by 1 test: temp->flags = 0x01; | 82 |
| 1862 | #endif | - |
| 1863 | temp->next = pushed_string_list; | - |
| 1864 | pushed_string_list = temp; | - |
| 1865 | | - |
| 1866 | #if defined (ALIAS) | - |
| 1867 | if (ap)| TRUE | evaluated 82 times by 1 test | | FALSE | evaluated 38 times by 1 test |
| 38-82 |
| 1868 | ap->flags |= AL_BEINGEXPANDED;executed 82 times by 1 test: ap->flags |= 0x2; | 82 |
| 1869 | #endif | - |
| 1870 | | - |
| 1871 | shell_input_line = s; | - |
| 1872 | shell_input_line_size = STRLEN (s);| TRUE | evaluated 100 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 100 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 102 times by 1 test | | FALSE | evaluated 18 times by 1 test |
| TRUE | evaluated 100 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 0-102 |
| 1873 | shell_input_line_index = 0; | - |
| 1874 | shell_input_line_terminator = '\0'; | - |
| 1875 | #if 0 | - |
| 1876 | parser_state &= ~PST_ALEXPNEXT; | - |
| 1877 | #endif | - |
| 1878 | | - |
| 1879 | set_line_mbstate (); | - |
| 1880 | }executed 120 times by 1 test: end of block | 120 |
| 1881 | | - |
| 1882 | | - |
| 1883 | | - |
| 1884 | | - |
| 1885 | | - |
| 1886 | | - |
| 1887 | | - |
| 1888 | static void | - |
| 1889 | pop_string () | - |
| 1890 | { | - |
| 1891 | STRING_SAVER *t; | - |
| 1892 | | - |
| 1893 | FREE (shell_input_line);executed 110 times by 1 test: sh_xfree((shell_input_line), "./parse.y", 1893); | TRUE | evaluated 110 times by 1 test | | FALSE | never evaluated |
| 0-110 |
| 1894 | shell_input_line = pushed_string_list->saved_line; | - |
| 1895 | shell_input_line_index = pushed_string_list->saved_line_index; | - |
| 1896 | shell_input_line_size = pushed_string_list->saved_line_size; | - |
| 1897 | shell_input_line_terminator = pushed_string_list->saved_line_terminator; | - |
| 1898 | | - |
| 1899 | if (pushed_string_list->expand_alias)| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 105 times by 1 test |
| 5-105 |
| 1900 | parser_state |= PST_ALEXPNEXT;executed 5 times by 1 test: parser_state |= 0x000002; | 5 |
| 1901 | else | - |
| 1902 | parser_state &= ~PST_ALEXPNEXT;executed 105 times by 1 test: parser_state &= ~0x000002; | 105 |
| 1903 | | - |
| 1904 | t = pushed_string_list; | - |
| 1905 | pushed_string_list = pushed_string_list->next; | - |
| 1906 | | - |
| 1907 | #if defined (ALIAS) | - |
| 1908 | if (t->expander)| TRUE | evaluated 72 times by 1 test | | FALSE | evaluated 38 times by 1 test |
| 38-72 |
| 1909 | t->expander->flags &= ~AL_BEINGEXPANDED;executed 72 times by 1 test: t->expander->flags &= ~0x2; | 72 |
| 1910 | #endif | - |
| 1911 | | - |
| 1912 | free ((char *)t); | - |
| 1913 | | - |
| 1914 | set_line_mbstate (); | - |
| 1915 | }executed 110 times by 1 test: end of block | 110 |
| 1916 | | - |
| 1917 | static void | - |
| 1918 | free_string_list () | - |
| 1919 | { | - |
| 1920 | register STRING_SAVER *t, *t1; | - |
| 1921 | | - |
| 1922 | for (t = pushed_string_list; t; )| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 4334 times by 1 test |
| 2-4334 |
| 1923 | { | - |
| 1924 | t1 = t->next; | - |
| 1925 | FREE (t->saved_line);executed 2 times by 1 test: sh_xfree((t->saved_line), "./parse.y", 1925); | TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 1926 | #if defined (ALIAS) | - |
| 1927 | if (t->expander)| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 1928 | t->expander->flags &= ~AL_BEINGEXPANDED;executed 2 times by 1 test: t->expander->flags &= ~0x2; | 2 |
| 1929 | #endif | - |
| 1930 | free ((char *)t); | - |
| 1931 | t = t1; | - |
| 1932 | }executed 2 times by 1 test: end of block | 2 |
| 1933 | pushed_string_list = (STRING_SAVER *)NULL; | - |
| 1934 | }executed 4334 times by 1 test: end of block | 4334 |
| 1935 | | - |
| 1936 | #endif /* ALIAS || DPAREN_ARITHMETIC */ | - |
| 1937 | | - |
| 1938 | void | - |
| 1939 | free_pushed_string_input () | - |
| 1940 | { | - |
| 1941 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 1942 | free_string_list (); | - |
| 1943 | #endif | - |
| 1944 | }executed 4332 times by 1 test: end of block | 4332 |
| 1945 | | - |
| 1946 | int | - |
| 1947 | parser_expanding_alias () | - |
| 1948 | { | - |
| 1949 | return (expanding_alias ());executed 1453134 times by 1 test: return ((pushed_string_list && pushed_string_list->expander)); | 1453134 |
| 1950 | } | - |
| 1951 | | - |
| 1952 | void | - |
| 1953 | parser_save_alias () | - |
| 1954 | { | - |
| 1955 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 1956 | push_string ((char *)NULL, 0, (alias_t *)NULL); | - |
| 1957 | pushed_string_list->flags = PSH_SOURCE; | - |
| 1958 | #else | - |
| 1959 | ; | - |
| 1960 | #endif | - |
| 1961 | }executed 18 times by 1 test: end of block | 18 |
| 1962 | | - |
| 1963 | void | - |
| 1964 | parser_restore_alias () | - |
| 1965 | { | - |
| 1966 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 1967 | if (pushed_string_list)| TRUE | evaluated 14 times by 1 test | | FALSE | never evaluated |
| 0-14 |
| 1968 | pop_string ();executed 14 times by 1 test: pop_string (); | 14 |
| 1969 | #else | - |
| 1970 | ; | - |
| 1971 | #endif | - |
| 1972 | }executed 14 times by 1 test: end of block | 14 |
| 1973 | | - |
| 1974 | #if defined (ALIAS) | - |
| 1975 | | - |
| 1976 | | - |
| 1977 | void | - |
| 1978 | clear_string_list_expander (ap) | - |
| 1979 | alias_t *ap; | - |
| 1980 | { | - |
| 1981 | register STRING_SAVER *t; | - |
| 1982 | | - |
| 1983 | for (t = pushed_string_list; t; t = t->next)| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 4 |
| 1984 | { | - |
| 1985 | if (t->expander && t->expander == ap)| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-4 |
| 1986 | t->expander = 0;executed 4 times by 1 test: t->expander = 0; | 4 |
| 1987 | }executed 4 times by 1 test: end of block | 4 |
| 1988 | }executed 4 times by 1 test: end of block | 4 |
| 1989 | #endif | - |
| 1990 | | - |
| 1991 | void | - |
| 1992 | clear_shell_input_line () | - |
| 1993 | { | - |
| 1994 | if (shell_input_line)| TRUE | evaluated 20976 times by 1 test | | FALSE | evaluated 291 times by 1 test |
| 291-20976 |
| 1995 | shell_input_line[shell_input_line_index = 0] = '\0';executed 20976 times by 1 test: shell_input_line[shell_input_line_index = 0] = '\0'; | 20976 |
| 1996 | }executed 21267 times by 1 test: end of block | 21267 |
| 1997 | | - |
| 1998 | | - |
| 1999 | | - |
| 2000 | | - |
| 2001 | | - |
| 2002 | static char * | - |
| 2003 | read_a_line (remove_quoted_newline) | - |
| 2004 | int remove_quoted_newline; | - |
| 2005 | { | - |
| 2006 | static char *line_buffer = (char *)NULL; | - |
| 2007 | static int buffer_size = 0; | - |
| 2008 | int indx, c, peekc, pass_next; | - |
| 2009 | | - |
| 2010 | #if defined (READLINE) | - |
| 2011 | if (no_line_editing && SHOULD_PROMPT ())| TRUE | evaluated 5258 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 5258 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-5258 |
| 2012 | #else | - |
| 2013 | if (SHOULD_PROMPT ()) | - |
| 2014 | #endif | - |
| 2015 | print_prompt (); never executed: print_prompt (); | 0 |
| 2016 | | - |
| 2017 | pass_next = indx = 0; | - |
| 2018 | while (1) | - |
| 2019 | { | - |
| 2020 | | - |
| 2021 | QUIT; never executed: termsig_handler (terminating_signal); never executed: throw_to_top_level (); | TRUE | never evaluated | | FALSE | evaluated 54784 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 54784 times by 1 test |
| 0-54784 |
| 2022 | | - |
| 2023 | c = yy_getc (); | - |
| 2024 | | - |
| 2025 | | - |
| 2026 | if (c == 0)| TRUE | never evaluated | | FALSE | evaluated 54784 times by 1 test |
| 0-54784 |
| 2027 | { | - |
| 2028 | #if 0 | - |
| 2029 | internal_warning ("read_a_line: ignored null byte in input"); | - |
| 2030 | #endif | - |
| 2031 | continue; never executed: continue; | 0 |
| 2032 | } | - |
| 2033 | | - |
| 2034 | | - |
| 2035 | if (c == EOF)| TRUE | evaluated 33 times by 1 test | | FALSE | evaluated 54751 times by 1 test |
| 33-54751 |
| 2036 | { | - |
| 2037 | if (interactive && bash_input.type == st_stream)| TRUE | never evaluated | | FALSE | evaluated 33 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-33 |
| 2038 | clearerr (stdin); never executed: clearerr ( stdin ); | 0 |
| 2039 | if (indx == 0)| TRUE | evaluated 17 times by 1 test | | FALSE | evaluated 16 times by 1 test |
| 16-17 |
| 2040 | return ((char *)NULL);executed 17 times by 1 test: return ((char *) ((void *)0) ); | 17 |
| 2041 | c = '\n'; | - |
| 2042 | }executed 16 times by 1 test: end of block | 16 |
| 2043 | | - |
| 2044 | | - |
| 2045 | RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128);executed 1314 times by 1 test: buffer_size += (128); executed 1314 times by 1 test: end of block | TRUE | evaluated 1314 times by 1 test | | FALSE | evaluated 53453 times by 1 test |
| TRUE | evaluated 1314 times by 1 test | | FALSE | evaluated 1314 times by 1 test |
| 1314-53453 |
| 2046 | | - |
| 2047 | | - |
| 2048 | | - |
| 2049 | | - |
| 2050 | | - |
| 2051 | | - |
| 2052 | | - |
| 2053 | if (pass_next)| TRUE | evaluated 1161 times by 1 test | | FALSE | evaluated 53606 times by 1 test |
| 1161-53606 |
| 2054 | { | - |
| 2055 | line_buffer[indx++] = c; | - |
| 2056 | pass_next = 0; | - |
| 2057 | }executed 1161 times by 1 test: end of block | 1161 |
| 2058 | else if (c == '\\' && remove_quoted_newline)| TRUE | evaluated 1183 times by 1 test | | FALSE | evaluated 52423 times by 1 test |
| TRUE | evaluated 1165 times by 1 test | | FALSE | evaluated 18 times by 1 test |
| 18-52423 |
| 2059 | { | - |
| 2060 | QUIT; never executed: termsig_handler (terminating_signal); never executed: throw_to_top_level (); | TRUE | never evaluated | | FALSE | evaluated 1165 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1165 times by 1 test |
| 0-1165 |
| 2061 | peekc = yy_getc (); | - |
| 2062 | if (peekc == '\n')| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 1161 times by 1 test |
| 4-1161 |
| 2063 | { | - |
| 2064 | line_number++; | - |
| 2065 | continue; executed 4 times by 1 test: continue; | 4 |
| 2066 | } | - |
| 2067 | else | - |
| 2068 | { | - |
| 2069 | yy_ungetc (peekc); | - |
| 2070 | pass_next = 1; | - |
| 2071 | line_buffer[indx++] = c; | - |
| 2072 | }executed 1161 times by 1 test: end of block | 1161 |
| 2073 | } | - |
| 2074 | else | - |
| 2075 | line_buffer[indx++] = c;executed 52441 times by 1 test: line_buffer[indx++] = c; | 52441 |
| 2076 | | - |
| 2077 | if (c == '\n')| TRUE | evaluated 5241 times by 1 test | | FALSE | evaluated 49522 times by 1 test |
| 5241-49522 |
| 2078 | { | - |
| 2079 | line_buffer[indx] = '\0'; | - |
| 2080 | return (line_buffer);executed 5241 times by 1 test: return (line_buffer); | 5241 |
| 2081 | } | - |
| 2082 | }executed 49522 times by 1 test: end of block | 49522 |
| 2083 | } never executed: end of block | 0 |
| 2084 | | - |
| 2085 | | - |
| 2086 | | - |
| 2087 | | - |
| 2088 | | - |
| 2089 | | - |
| 2090 | char * | - |
| 2091 | read_secondary_line (remove_quoted_newline) | - |
| 2092 | int remove_quoted_newline; | - |
| 2093 | { | - |
| 2094 | char *ret; | - |
| 2095 | int n, c; | - |
| 2096 | | - |
| 2097 | prompt_string_pointer = &ps2_prompt; | - |
| 2098 | if (SHOULD_PROMPT())| TRUE | never evaluated | | FALSE | evaluated 5258 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-5258 |
| 2099 | prompt_again (); never executed: prompt_again (); | 0 |
| 2100 | ret = read_a_line (remove_quoted_newline); | - |
| 2101 | #if defined (HISTORY) | - |
| 2102 | if (ret && remember_on_history && (parser_state & PST_HEREDOC))| TRUE | evaluated 5241 times by 1 test | | FALSE | evaluated 17 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 5237 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-5241 |
| 2103 | { | - |
| 2104 | | - |
| 2105 | | - |
| 2106 | | - |
| 2107 | | - |
| 2108 | | - |
| 2109 | | - |
| 2110 | current_command_line_count++; | - |
| 2111 | maybe_add_history (ret); | - |
| 2112 | }executed 4 times by 1 test: end of block | 4 |
| 2113 | #endif /* HISTORY */ | - |
| 2114 | return ret;executed 5258 times by 1 test: return ret; | 5258 |
| 2115 | } | - |
| 2116 | | - |
| 2117 | | - |
| 2118 | | - |
| 2119 | | - |
| 2120 | | - |
| 2121 | | - |
| 2122 | | - |
| 2123 | | - |
| 2124 | | - |
| 2125 | STRING_INT_ALIST word_token_alist[] = { | - |
| 2126 | { "if", IF }, | - |
| 2127 | { "then", THEN }, | - |
| 2128 | { "else", ELSE }, | - |
| 2129 | { "elif", ELIF }, | - |
| 2130 | { "fi", FI }, | - |
| 2131 | { "case", CASE }, | - |
| 2132 | { "esac", ESAC }, | - |
| 2133 | { "for", FOR }, | - |
| 2134 | #if defined (SELECT_COMMAND) | - |
| 2135 | { "select", SELECT }, | - |
| 2136 | #endif | - |
| 2137 | { "while", WHILE }, | - |
| 2138 | { "until", UNTIL }, | - |
| 2139 | { "do", DO }, | - |
| 2140 | { "done", DONE }, | - |
| 2141 | { "in", IN }, | - |
| 2142 | { "function", FUNCTION }, | - |
| 2143 | #if defined (COMMAND_TIMING) | - |
| 2144 | { "time", TIME }, | - |
| 2145 | #endif | - |
| 2146 | { "{", '{' }, | - |
| 2147 | { "}", '}' }, | - |
| 2148 | { "!", BANG }, | - |
| 2149 | #if defined (COND_COMMAND) | - |
| 2150 | { "[[", COND_START }, | - |
| 2151 | { "]]", COND_END }, | - |
| 2152 | #endif | - |
| 2153 | #if defined (COPROCESS_SUPPORT) | - |
| 2154 | { "coproc", COPROC }, | - |
| 2155 | #endif | - |
| 2156 | { (char *)NULL, 0} | - |
| 2157 | }; | - |
| 2158 | | - |
| 2159 | | - |
| 2160 | STRING_INT_ALIST other_token_alist[] = { | - |
| 2161 | | - |
| 2162 | { "--", TIMEIGN }, | - |
| 2163 | { "-p", TIMEOPT }, | - |
| 2164 | { "&&", AND_AND }, | - |
| 2165 | { "||", OR_OR }, | - |
| 2166 | { ">>", GREATER_GREATER }, | - |
| 2167 | { "<<", LESS_LESS }, | - |
| 2168 | { "<&", LESS_AND }, | - |
| 2169 | { ">&", GREATER_AND }, | - |
| 2170 | { ";;", SEMI_SEMI }, | - |
| 2171 | { ";&", SEMI_AND }, | - |
| 2172 | { ";;&", SEMI_SEMI_AND }, | - |
| 2173 | { "<<-", LESS_LESS_MINUS }, | - |
| 2174 | { "<<<", LESS_LESS_LESS }, | - |
| 2175 | { "&>", AND_GREATER }, | - |
| 2176 | { "&>>", AND_GREATER_GREATER }, | - |
| 2177 | { "<>", LESS_GREATER }, | - |
| 2178 | { ">|", GREATER_BAR }, | - |
| 2179 | { "|&", BAR_AND }, | - |
| 2180 | { "EOF", yacc_EOF }, | - |
| 2181 | | - |
| 2182 | { ">", '>' }, | - |
| 2183 | { "<", '<' }, | - |
| 2184 | { "-", '-' }, | - |
| 2185 | { "{", '{' }, | - |
| 2186 | { "}", '}' }, | - |
| 2187 | { ";", ';' }, | - |
| 2188 | { "(", '(' }, | - |
| 2189 | { ")", ')' }, | - |
| 2190 | { "|", '|' }, | - |
| 2191 | { "&", '&' }, | - |
| 2192 | { "newline", '\n' }, | - |
| 2193 | { (char *)NULL, 0} | - |
| 2194 | }; | - |
| 2195 | | - |
| 2196 | | - |
| 2197 | | - |
| 2198 | | - |
| 2199 | | - |
| 2200 | | - |
| 2201 | | - |
| 2202 | | - |
| 2203 | | - |
| 2204 | | - |
| 2205 | | - |
| 2206 | | - |
| 2207 | | - |
| 2208 | | - |
| 2209 | struct dstack dstack = { (char *)NULL, 0, 0 }; | - |
| 2210 | | - |
| 2211 | | - |
| 2212 | | - |
| 2213 | | - |
| 2214 | static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; | - |
| 2215 | | - |
| 2216 | | - |
| 2217 | | - |
| 2218 | #define current_delimiter(ds) \ | - |
| 2219 | (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) | - |
| 2220 | | - |
| 2221 | #define push_delimiter(ds, character) \ | - |
| 2222 | do \ | - |
| 2223 | { \ | - |
| 2224 | if (ds.delimiter_depth + 2 > ds.delimiter_space) \ | - |
| 2225 | ds.delimiters = (char *)xrealloc \ | - |
| 2226 | (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ | - |
| 2227 | ds.delimiters[ds.delimiter_depth] = character; \ | - |
| 2228 | ds.delimiter_depth++; \ | - |
| 2229 | } \ | - |
| 2230 | while (0) | - |
| 2231 | | - |
| 2232 | #define pop_delimiter(ds) ds.delimiter_depth-- | - |
| 2233 | | - |
| 2234 | | - |
| 2235 | | - |
| 2236 | | - |
| 2237 | | - |
| 2238 | | - |
| 2239 | | - |
| 2240 | | - |
| 2241 | | - |
| 2242 | static int eol_ungetc_lookahead = 0; | - |
| 2243 | | - |
| 2244 | static int | - |
| 2245 | shell_getc (remove_quoted_newline) | - |
| 2246 | int remove_quoted_newline; | - |
| 2247 | { | - |
| 2248 | register int i; | - |
| 2249 | int c, truncating, last_was_backslash; | - |
| 2250 | unsigned char uc; | - |
| 2251 | | - |
| 2252 | QUIT; never executed: termsig_handler (terminating_signal); never executed: throw_to_top_level (); | TRUE | never evaluated | | FALSE | evaluated 24151082 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 24151082 times by 1 test |
| 0-24151082 |
| 2253 | | - |
| 2254 | last_was_backslash = 0; | - |
| 2255 | if (sigwinch_received)| TRUE | never evaluated | | FALSE | evaluated 24151082 times by 1 test |
| 0-24151082 |
| 2256 | { | - |
| 2257 | sigwinch_received = 0; | - |
| 2258 | get_new_window_size (0, (int *)0, (int *)0); | - |
| 2259 | } never executed: end of block | 0 |
| 2260 | | - |
| 2261 | if (eol_ungetc_lookahead)| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 24151080 times by 1 test |
| 2-24151080 |
| 2262 | { | - |
| 2263 | c = eol_ungetc_lookahead; | - |
| 2264 | eol_ungetc_lookahead = 0; | - |
| 2265 | return (c);executed 2 times by 1 test: return (c); | 2 |
| 2266 | } | - |
| 2267 | | - |
| 2268 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 2269 | | - |
| 2270 | | - |
| 2271 | | - |
| 2272 | | - |
| 2273 | if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) &&| TRUE | evaluated 710883 times by 1 test | | FALSE | evaluated 23440197 times by 1 test |
| TRUE | evaluated 717182 times by 1 test | | FALSE | evaluated 22723015 times by 1 test |
| 710883-23440197 |
| 2274 | (pushed_string_list == (STRING_SAVER *)NULL)))| TRUE | evaluated 716995 times by 1 test | | FALSE | evaluated 187 times by 1 test |
| 187-716995 |
| 2275 | #else /* !ALIAS && !DPAREN_ARITHMETIC */ | - |
| 2276 | if (!shell_input_line || !shell_input_line[shell_input_line_index]) | - |
| 2277 | #endif /* !ALIAS && !DPAREN_ARITHMETIC */ | - |
| 2278 | { | - |
| 2279 | line_number++; | - |
| 2280 | | - |
| 2281 | | - |
| 2282 | if (shell_input_line && shell_input_line_size >= 32768)| TRUE | evaluated 716995 times by 1 test | | FALSE | evaluated 710883 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 716995 times by 1 test |
| 0-716995 |
| 2283 | { | - |
| 2284 | free (shell_input_line); | - |
| 2285 | shell_input_line = 0; | - |
| 2286 | shell_input_line_size = 0; | - |
| 2287 | } never executed: end of block | 0 |
| 2288 | | - |
| 2289 | restart_read:code before this statement executed 1427878 times by 1 test: restart_read: | 1427878 |
| 2290 | | - |
| 2291 | | - |
| 2292 | QUIT; never executed: termsig_handler (terminating_signal); never executed: throw_to_top_level (); | TRUE | never evaluated | | FALSE | evaluated 1464900 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1464900 times by 1 test |
| 0-1464900 |
| 2293 | | - |
| 2294 | i = truncating = 0; | - |
| 2295 | shell_input_line_terminator = 0; | - |
| 2296 | | - |
| 2297 | | - |
| 2298 | | - |
| 2299 | | - |
| 2300 | | - |
| 2301 | if (interactive_shell == 0 || SHOULD_PROMPT())| TRUE | evaluated 1459523 times by 1 test | | FALSE | evaluated 5377 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 5377 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-1459523 |
| 2302 | { | - |
| 2303 | #if defined (JOB_CONTROL) | - |
| 2304 | | - |
| 2305 | | - |
| 2306 | | - |
| 2307 | | - |
| 2308 | notify_and_cleanup (); | - |
| 2309 | #else /* !JOB_CONTROL */ | - |
| 2310 | cleanup_dead_jobs (); | - |
| 2311 | #endif /* !JOB_CONTROL */ | - |
| 2312 | }executed 1459523 times by 1 test: end of block | 1459523 |
| 2313 | | - |
| 2314 | #if defined (READLINE) | - |
| 2315 | if (no_line_editing && SHOULD_PROMPT())| TRUE | evaluated 1459497 times by 1 test | | FALSE | evaluated 5403 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1459497 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-1459497 |
| 2316 | #else | - |
| 2317 | if (SHOULD_PROMPT()) | - |
| 2318 | #endif | - |
| 2319 | print_prompt (); never executed: print_prompt (); | 0 |
| 2320 | | - |
| 2321 | if (bash_input.type == st_stream)| TRUE | never evaluated | | FALSE | evaluated 1464900 times by 1 test |
| 0-1464900 |
| 2322 | clearerr (stdin); never executed: clearerr ( stdin ); | 0 |
| 2323 | | - |
| 2324 | while (1) | - |
| 2325 | { | - |
| 2326 | c = yy_getc (); | - |
| 2327 | | - |
| 2328 | | - |
| 2329 | QUIT; never executed: termsig_handler (terminating_signal); never executed: throw_to_top_level (); | TRUE | never evaluated | | FALSE | evaluated 20751284 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 20751284 times by 1 test |
| 0-20751284 |
| 2330 | | - |
| 2331 | if (c == '\0')| TRUE | never evaluated | | FALSE | evaluated 20751284 times by 1 test |
| 0-20751284 |
| 2332 | { | - |
| 2333 | #if 0 | - |
| 2334 | internal_warning ("shell_getc: ignored null byte in input"); | - |
| 2335 | #endif | - |
| 2336 | | - |
| 2337 | | - |
| 2338 | if (bash_input.type == st_string)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2339 | { | - |
| 2340 | if (i == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2341 | shell_input_line_terminator = EOF; never executed: shell_input_line_terminator = (-1) ; | 0 |
| 2342 | shell_input_line[i] = '\0'; | - |
| 2343 | c = EOF; | - |
| 2344 | break; never executed: break; | 0 |
| 2345 | } | - |
| 2346 | continue; never executed: continue; | 0 |
| 2347 | } | - |
| 2348 | | - |
| 2349 | | - |
| 2350 | | - |
| 2351 | | - |
| 2352 | | - |
| 2353 | if (shell_input_line_size > (SIZE_MAX - 256))| TRUE | never evaluated | | FALSE | evaluated 20751284 times by 1 test |
| 0-20751284 |
| 2354 | { | - |
| 2355 | size_t n; | - |
| 2356 | | - |
| 2357 | n = SIZE_MAX - i; | - |
| 2358 | if (n <= 2) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2359 | { | - |
| 2360 | if (truncating == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2361 | internal_warning(_("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%lu): line truncated"), shell_input_line_size, (unsigned long)SIZE_MAX); never executed: internal_warning( dcgettext (((void *)0), "shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%lu): line truncated" , 5) , shell_input_line_size, (unsigned long) (18446744073709551615UL) ); | 0 |
| 2362 | shell_input_line[i] = '\0'; | - |
| 2363 | truncating = 1; | - |
| 2364 | } never executed: end of block | 0 |
| 2365 | if (shell_input_line_size < SIZE_MAX)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2366 | { | - |
| 2367 | shell_input_line_size = SIZE_MAX; | - |
| 2368 | shell_input_line = xrealloc (shell_input_line, shell_input_line_size); | - |
| 2369 | } never executed: end of block | 0 |
| 2370 | } never executed: end of block | 0 |
| 2371 | else | - |
| 2372 | RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256);executed 711448 times by 1 test: shell_input_line_size += (256); executed 711448 times by 1 test: end of block executed 20751284 times by 1 test: end of block | TRUE | evaluated 711448 times by 1 test | | FALSE | evaluated 20039836 times by 1 test |
| TRUE | evaluated 711448 times by 1 test | | FALSE | evaluated 711448 times by 1 test |
| 711448-20751284 |
| 2373 | | - |
| 2374 | if (c == EOF)| TRUE | evaluated 725879 times by 1 test | | FALSE | evaluated 20025405 times by 1 test |
| 725879-20025405 |
| 2375 | { | - |
| 2376 | if (bash_input.type == st_stream)| TRUE | never evaluated | | FALSE | evaluated 725879 times by 1 test |
| 0-725879 |
| 2377 | clearerr (stdin); never executed: clearerr ( stdin ); | 0 |
| 2378 | | - |
| 2379 | if (i == 0)| TRUE | evaluated 369 times by 1 test | | FALSE | evaluated 725510 times by 1 test |
| 369-725510 |
| 2380 | shell_input_line_terminator = EOF;executed 369 times by 1 test: shell_input_line_terminator = (-1) ; | 369 |
| 2381 | | - |
| 2382 | shell_input_line[i] = '\0'; | - |
| 2383 | break;executed 725879 times by 1 test: break; | 725879 |
| 2384 | } | - |
| 2385 | | - |
| 2386 | if (truncating == 0 || c == '\n')| TRUE | evaluated 20025405 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20025405 |
| 2387 | shell_input_line[i++] = c;executed 20025405 times by 1 test: shell_input_line[i++] = c; | 20025405 |
| 2388 | | - |
| 2389 | if (c == '\n')| TRUE | evaluated 739021 times by 1 test | | FALSE | evaluated 19286384 times by 1 test |
| 739021-19286384 |
| 2390 | { | - |
| 2391 | shell_input_line[--i] = '\0'; | - |
| 2392 | current_command_line_count++; | - |
| 2393 | break;executed 739021 times by 1 test: break; | 739021 |
| 2394 | } | - |
| 2395 | | - |
| 2396 | last_was_backslash = last_was_backslash == 0 && c == '\\';| TRUE | evaluated 19122968 times by 1 test | | FALSE | evaluated 163416 times by 1 test |
| TRUE | evaluated 200702 times by 1 test | | FALSE | evaluated 18922266 times by 1 test |
| 163416-19122968 |
| 2397 | }executed 19286384 times by 1 test: end of block | 19286384 |
| 2398 | | - |
| 2399 | shell_input_line_index = 0; | - |
| 2400 | shell_input_line_len = i; | - |
| 2401 | | - |
| 2402 | set_line_mbstate (); | - |
| 2403 | | - |
| 2404 | #if defined (HISTORY) | - |
| 2405 | if (remember_on_history && shell_input_line && shell_input_line[0])| TRUE | evaluated 685 times by 1 test | | FALSE | evaluated 1464215 times by 1 test |
| TRUE | evaluated 685 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 491 times by 1 test | | FALSE | evaluated 194 times by 1 test |
| 0-1464215 |
| 2406 | { | - |
| 2407 | char *expansions; | - |
| 2408 | # if defined (BANG_HISTORY) | - |
| 2409 | int old_hist; | - |
| 2410 | | - |
| 2411 | | - |
| 2412 | | - |
| 2413 | | - |
| 2414 | old_hist = history_expansion_inhibited; | - |
| 2415 | if (current_delimiter (dstack) == '\'')| TRUE | never evaluated | | FALSE | evaluated 491 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 491 times by 1 test |
| 0-491 |
| 2416 | history_expansion_inhibited = 1; never executed: history_expansion_inhibited = 1; | 0 |
| 2417 | # endif | - |
| 2418 | | - |
| 2419 | | - |
| 2420 | expansions = pre_process_line (shell_input_line, 1, 1); | - |
| 2421 | # if defined (BANG_HISTORY) | - |
| 2422 | history_expansion_inhibited = old_hist; | - |
| 2423 | # endif | - |
| 2424 | if (expansions != shell_input_line)| TRUE | evaluated 206 times by 1 test | | FALSE | evaluated 285 times by 1 test |
| 206-285 |
| 2425 | { | - |
| 2426 | free (shell_input_line); | - |
| 2427 | shell_input_line = expansions; | - |
| 2428 | shell_input_line_len = shell_input_line ?| TRUE | evaluated 202 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 4-202 |
| 2429 | strlen (shell_input_line) : 0; | - |
| 2430 | if (shell_input_line_len == 0)| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 202 times by 1 test |
| 4-202 |
| 2431 | current_command_line_count--;executed 4 times by 1 test: current_command_line_count--; | 4 |
| 2432 | | - |
| 2433 | | - |
| 2434 | | - |
| 2435 | shell_input_line_size = shell_input_line_len; | - |
| 2436 | | - |
| 2437 | set_line_mbstate (); | - |
| 2438 | }executed 206 times by 1 test: end of block | 206 |
| 2439 | }executed 491 times by 1 test: end of block | 491 |
| 2440 | | - |
| 2441 | | - |
| 2442 | else if (remember_on_history && shell_input_line &&| TRUE | evaluated 194 times by 1 test | | FALSE | evaluated 1464215 times by 1 test |
| TRUE | evaluated 194 times by 1 test | | FALSE | never evaluated |
| 0-1464215 |
| 2443 | shell_input_line[0] == '\0' &&| TRUE | evaluated 194 times by 1 test | | FALSE | never evaluated |
| 0-194 |
| 2444 | current_command_line_count > 1)| TRUE | never evaluated | | FALSE | evaluated 194 times by 1 test |
| 0-194 |
| 2445 | { | - |
| 2446 | if (current_delimiter (dstack))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2447 | | - |
| 2448 | | - |
| 2449 | | - |
| 2450 | | - |
| 2451 | maybe_add_history (shell_input_line); never executed: maybe_add_history (shell_input_line); | 0 |
| 2452 | else | - |
| 2453 | { | - |
| 2454 | char *hdcs; | - |
| 2455 | hdcs = history_delimiting_chars (shell_input_line); | - |
| 2456 | if (hdcs && hdcs[0] == ';')| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2457 | maybe_add_history (shell_input_line); never executed: maybe_add_history (shell_input_line); | 0 |
| 2458 | } never executed: end of block | 0 |
| 2459 | } | - |
| 2460 | | - |
| 2461 | #endif /* HISTORY */ | - |
| 2462 | | - |
| 2463 | if (shell_input_line)| TRUE | evaluated 1464896 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 4-1464896 |
| 2464 | { | - |
| 2465 | | - |
| 2466 | | - |
| 2467 | | - |
| 2468 | | - |
| 2469 | | - |
| 2470 | | - |
| 2471 | if (echo_input_at_read && (shell_input_line[0] ||| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 1464894 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-1464894 |
| 2472 | shell_input_line_terminator != EOF) &&| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2473 | shell_eof_token == 0)| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 2474 | fprintf (stderr, "%s\n", shell_input_line);executed 2 times by 1 test: fprintf ( stderr , "%s\n", shell_input_line); | 2 |
| 2475 | }executed 1464896 times by 1 test: end of block | 1464896 |
| 2476 | else | - |
| 2477 | { | - |
| 2478 | shell_input_line_size = 0; | - |
| 2479 | prompt_string_pointer = ¤t_prompt_string; | - |
| 2480 | if (SHOULD_PROMPT ())| TRUE | never evaluated | | FALSE | evaluated 4 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-4 |
| 2481 | prompt_again (); never executed: prompt_again (); | 0 |
| 2482 | goto restart_read;executed 4 times by 1 test: goto restart_read; | 4 |
| 2483 | } | - |
| 2484 | | - |
| 2485 | | - |
| 2486 | | - |
| 2487 | if (shell_input_line_terminator != EOF)| TRUE | evaluated 1464527 times by 1 test | | FALSE | evaluated 369 times by 1 test |
| 369-1464527 |
| 2488 | { | - |
| 2489 | if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))| TRUE | evaluated 1464527 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 202 times by 1 test | | FALSE | evaluated 1464325 times by 1 test |
| 0-1464527 |
| 2490 | shell_input_line = (char *)xrealloc (shell_input_line,executed 202 times by 1 test: shell_input_line = (char *)sh_xrealloc((shell_input_line), (1 + (shell_input_line_size += 2)), "./parse.y" , 2491 ) ; | 202 |
| 2491 | 1 + (shell_input_line_size += 2));executed 202 times by 1 test: shell_input_line = (char *)sh_xrealloc((shell_input_line), (1 + (shell_input_line_size += 2)), "./parse.y" , 2491 ) ; | 202 |
| 2492 | | - |
| 2493 | | - |
| 2494 | | - |
| 2495 | | - |
| 2496 | | - |
| 2497 | if (bash_input.type == st_string && expanding_alias() == 0 && last_was_backslash && c == EOF && remove_quoted_newline)| TRUE | evaluated 737483 times by 1 test | | FALSE | evaluated 727044 times by 1 test |
| TRUE | evaluated 737483 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 45 times by 1 test | | FALSE | evaluated 737438 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 45 times by 1 test |
| TRUE | evaluated 317 times by 1 test | | FALSE | evaluated 737166 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 314 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | never evaluated |
| 0-737483 |
| 2498 | shell_input_line[shell_input_line_len] = '\\';executed 3 times by 1 test: shell_input_line[shell_input_line_len] = '\\'; | 3 |
| 2499 | else | - |
| 2500 | shell_input_line[shell_input_line_len] = '\n';executed 1464524 times by 1 test: shell_input_line[shell_input_line_len] = '\n'; | 1464524 |
| 2501 | shell_input_line[shell_input_line_len + 1] = '\0'; | - |
| 2502 | | - |
| 2503 | set_line_mbstate (); | - |
| 2504 | }executed 1464527 times by 1 test: end of block | 1464527 |
| 2505 | }executed 1464896 times by 1 test: end of block | 1464896 |
| 2506 | | - |
| 2507 | next_alias_char:code before this statement executed 24188098 times by 1 test: next_alias_char: | 24188098 |
| 2508 | uc = shell_input_line[shell_input_line_index]; | - |
| 2509 | | - |
| 2510 | if (uc)| TRUE | evaluated 24187542 times by 1 test | | FALSE | evaluated 556 times by 1 test |
| 556-24187542 |
| 2511 | shell_input_line_index++;executed 24187542 times by 1 test: shell_input_line_index++; | 24187542 |
| 2512 | | - |
| 2513 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 2514 | | - |
| 2515 | | - |
| 2516 | | - |
| 2517 | | - |
| 2518 | | - |
| 2519 | | - |
| 2520 | | - |
| 2521 | | - |
| 2522 | | - |
| 2523 | | - |
| 2524 | | - |
| 2525 | | - |
| 2526 | | - |
| 2527 | | - |
| 2528 | | - |
| 2529 | | - |
| 2530 | | - |
| 2531 | | - |
| 2532 | | - |
| 2533 | | - |
| 2534 | | - |
| 2535 | | - |
| 2536 | #ifndef OLD_ALIAS_HACK | - |
| 2537 | if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE &&| TRUE | evaluated 556 times by 1 test | | FALSE | evaluated 24187542 times by 1 test |
| TRUE | evaluated 187 times by 1 test | | FALSE | evaluated 369 times by 1 test |
| TRUE | evaluated 160 times by 1 test | | FALSE | evaluated 27 times by 1 test |
| 27-24187542 |
| 2538 | shell_input_line_index > 0 &&| TRUE | evaluated 158 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-158 |
| 2539 | shell_input_line[shell_input_line_index-1] != ' ' &&| TRUE | evaluated 89 times by 1 test | | FALSE | evaluated 69 times by 1 test |
| 69-89 |
| 2540 | shell_input_line[shell_input_line_index-1] != '\n' &&| TRUE | evaluated 86 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| 3-86 |
| 2541 | shellmeta (shell_input_line[shell_input_line_index-1]) == 0 &&| TRUE | evaluated 66 times by 1 test | | FALSE | evaluated 20 times by 1 test |
| 20-66 |
| 2542 | (current_delimiter (dstack) != '\'' && current_delimiter (dstack) != '"'))| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 64 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 64 times by 1 test |
| TRUE | evaluated 64 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| TRUE | evaluated 64 times by 1 test | | FALSE | never evaluated |
| 0-64 |
| 2543 | { | - |
| 2544 | return ' '; executed 64 times by 1 test: return ' '; | 64 |
| 2545 | } | - |
| 2546 | #endif | - |
| 2547 | | - |
| 2548 | pop_alias:code before this statement executed 24188034 times by 1 test: pop_alias: | 24188034 |
| 2549 | if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE)| TRUE | evaluated 492 times by 1 test | | FALSE | evaluated 24187542 times by 1 test |
| TRUE | evaluated 123 times by 1 test | | FALSE | evaluated 369 times by 1 test |
| TRUE | evaluated 96 times by 1 test | | FALSE | evaluated 27 times by 1 test |
| 27-24187542 |
| 2550 | { | - |
| 2551 | pop_string (); | - |
| 2552 | uc = shell_input_line[shell_input_line_index]; | - |
| 2553 | if (uc)| TRUE | evaluated 96 times by 1 test | | FALSE | never evaluated |
| 0-96 |
| 2554 | shell_input_line_index++;executed 96 times by 1 test: shell_input_line_index++; | 96 |
| 2555 | }executed 96 times by 1 test: end of block | 96 |
| 2556 | #endif /* ALIAS || DPAREN_ARITHMETIC */ | - |
| 2557 | | - |
| 2558 | if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n')| TRUE | evaluated 36991 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 201841 times by 1 test | | FALSE | evaluated 23986193 times by 1 test |
| TRUE | evaluated 192368 times by 1 test | | FALSE | evaluated 9473 times by 1 test |
| TRUE | evaluated 36991 times by 1 test | | FALSE | evaluated 155377 times by 1 test |
| TRUE | evaluated 36991 times by 1 test | | FALSE | never evaluated |
| 0-23986193 |
| 2559 | { | - |
| 2560 | if (SHOULD_PROMPT ())| TRUE | never evaluated | | FALSE | evaluated 36991 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-36991 |
| 2561 | prompt_again (); never executed: prompt_again (); | 0 |
| 2562 | line_number++; | - |
| 2563 | | - |
| 2564 | | - |
| 2565 | | - |
| 2566 | | - |
| 2567 | | - |
| 2568 | | - |
| 2569 | #if defined (ALIAS) | - |
| 2570 | if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0')| TRUE | never evaluated | | FALSE | evaluated 36991 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-36991 |
| 2571 | { | - |
| 2572 | uc = 0; | - |
| 2573 | goto pop_alias; never executed: goto pop_alias; | 0 |
| 2574 | } | - |
| 2575 | else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0')| TRUE | never evaluated | | FALSE | evaluated 36991 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-36991 |
| 2576 | { | - |
| 2577 | shell_input_line_index++; | - |
| 2578 | goto next_alias_char; never executed: goto next_alias_char; | 0 |
| 2579 | } | - |
| 2580 | else | - |
| 2581 | #endif | - |
| 2582 | goto restart_read;executed 36991 times by 1 test: goto restart_read; | 36991 |
| 2583 | } | - |
| 2584 | | - |
| 2585 | if (uc == 0 && shell_input_line_terminator == EOF)| TRUE | evaluated 396 times by 1 test | | FALSE | evaluated 24150647 times by 1 test |
| TRUE | evaluated 369 times by 1 test | | FALSE | evaluated 27 times by 1 test |
| 27-24150647 |
| 2586 | return ((shell_input_line_index != 0) ? '\n' : EOF);executed 369 times by 1 test: return ((shell_input_line_index != 0) ? '\n' : (-1) ); | 369 |
| 2587 | | - |
| 2588 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 2589 | | - |
| 2590 | | - |
| 2591 | | - |
| 2592 | | - |
| 2593 | | - |
| 2594 | | - |
| 2595 | | - |
| 2596 | | - |
| 2597 | | - |
| 2598 | | - |
| 2599 | | - |
| 2600 | | - |
| 2601 | if (uc == 0 && bash_input.type == st_string && *bash_input.location.string &&| TRUE | evaluated 27 times by 1 test | | FALSE | evaluated 24150647 times by 1 test |
| TRUE | evaluated 27 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 27 times by 1 test | | FALSE | never evaluated |
| 0-24150647 |
| 2602 | pushed_string_list && pushed_string_list->flags == PSH_SOURCE &&| TRUE | evaluated 27 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 27 times by 1 test | | FALSE | never evaluated |
| 0-27 |
| 2603 | shell_input_line_terminator == 0)| TRUE | evaluated 27 times by 1 test | | FALSE | never evaluated |
| 0-27 |
| 2604 | { | - |
| 2605 | shell_input_line_index = 0; | - |
| 2606 | goto restart_read;executed 27 times by 1 test: goto restart_read; | 27 |
| 2607 | } | - |
| 2608 | #endif | - |
| 2609 | | - |
| 2610 | return (uc);executed 24150647 times by 1 test: return (uc); | 24150647 |
| 2611 | } | - |
| 2612 | | - |
| 2613 | | - |
| 2614 | | - |
| 2615 | | - |
| 2616 | | - |
| 2617 | | - |
| 2618 | static void | - |
| 2619 | shell_ungetc (c) | - |
| 2620 | int c; | - |
| 2621 | { | - |
| 2622 | if (shell_input_line && shell_input_line_index)| TRUE | evaluated 4418581 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4418579 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 0-4418581 |
| 2623 | shell_input_line[--shell_input_line_index] = c;executed 4418579 times by 1 test: shell_input_line[--shell_input_line_index] = c; | 4418579 |
| 2624 | else | - |
| 2625 | eol_ungetc_lookahead = c;executed 2 times by 1 test: eol_ungetc_lookahead = c; | 2 |
| 2626 | } | - |
| 2627 | | - |
| 2628 | char * | - |
| 2629 | parser_remaining_input () | - |
| 2630 | { | - |
| 2631 | if (shell_input_line == 0)| TRUE | never evaluated | | FALSE | evaluated 52 times by 1 test |
| 0-52 |
| 2632 | return 0; never executed: return 0; | 0 |
| 2633 | if ((int)shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)| TRUE | never evaluated | | FALSE | evaluated 52 times by 1 test |
| TRUE | evaluated 52 times by 1 test | | FALSE | never evaluated |
| 0-52 |
| 2634 | return ""; executed 52 times by 1 test: return ""; | 52 |
| 2635 | return (shell_input_line + shell_input_line_index); never executed: return (shell_input_line + shell_input_line_index); | 0 |
| 2636 | } | - |
| 2637 | | - |
| 2638 | #ifdef INCLUDE_UNUSED | - |
| 2639 | | - |
| 2640 | static void | - |
| 2641 | shell_ungetchar () | - |
| 2642 | { | - |
| 2643 | if (shell_input_line && shell_input_line_index) | - |
| 2644 | shell_input_line_index--; | - |
| 2645 | } | - |
| 2646 | #endif | - |
| 2647 | | - |
| 2648 | | - |
| 2649 | | - |
| 2650 | static void | - |
| 2651 | discard_until (character) | - |
| 2652 | int character; | - |
| 2653 | { | - |
| 2654 | int c; | - |
| 2655 | | - |
| 2656 | while ((c = shell_getc (0)) != EOF && c != character)| TRUE | evaluated 1680916 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1645440 times by 1 test | | FALSE | evaluated 35476 times by 1 test |
| 0-1680916 |
| 2657 | ;executed 1645440 times by 1 test: ; | 1645440 |
| 2658 | | - |
| 2659 | if (c != EOF)| TRUE | evaluated 35476 times by 1 test | | FALSE | never evaluated |
| 0-35476 |
| 2660 | shell_ungetc (c);executed 35476 times by 1 test: shell_ungetc (c); | 35476 |
| 2661 | }executed 35476 times by 1 test: end of block | 35476 |
| 2662 | | - |
| 2663 | void | - |
| 2664 | execute_variable_command (command, vname) | - |
| 2665 | char *command, *vname; | - |
| 2666 | { | - |
| 2667 | char *last_lastarg; | - |
| 2668 | sh_parser_state_t ps; | - |
| 2669 | | - |
| 2670 | save_parser_state (&ps); | - |
| 2671 | last_lastarg = get_string_value ("_"); | - |
| 2672 | if (last_lastarg)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2673 | last_lastarg = savestring (last_lastarg); never executed: last_lastarg = (char *)strcpy (sh_xmalloc((1 + strlen (last_lastarg)), "./parse.y", 2673), (last_lastarg)); | 0 |
| 2674 | | - |
| 2675 | parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); | - |
| 2676 | | - |
| 2677 | restore_parser_state (&ps); | - |
| 2678 | bind_variable ("_", last_lastarg, 0); | - |
| 2679 | FREE (last_lastarg); never executed: sh_xfree((last_lastarg), "./parse.y", 2679); | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2680 | | - |
| 2681 | if (token_to_read == '\n') | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2682 | token_to_read = 0; never executed: token_to_read = 0; | 0 |
| 2683 | } never executed: end of block | 0 |
| 2684 | | - |
| 2685 | void | - |
| 2686 | push_token (x) | - |
| 2687 | int x; | - |
| 2688 | { | - |
| 2689 | two_tokens_ago = token_before_that; | - |
| 2690 | token_before_that = last_read_token; | - |
| 2691 | last_read_token = current_token; | - |
| 2692 | | - |
| 2693 | current_token = x; | - |
| 2694 | } never executed: end of block | 0 |
| 2695 | | - |
| 2696 | | - |
| 2697 | | - |
| 2698 | static char *token = (char *)NULL; | - |
| 2699 | | - |
| 2700 | | - |
| 2701 | static int token_buffer_size; | - |
| 2702 | | - |
| 2703 | | - |
| 2704 | #define READ 0 | - |
| 2705 | #define RESET 1 | - |
| 2706 | #define prompt_is_ps1 \ | - |
| 2707 | (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) | - |
| 2708 | | - |
| 2709 | | - |
| 2710 | | - |
| 2711 | static int | - |
| 2712 | yylex () | - |
| 2713 | { | - |
| 2714 | if (interactive && (current_token == 0 || current_token == '\n'))| TRUE | never evaluated | | FALSE | evaluated 4829449 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-4829449 |
| 2715 | { | - |
| 2716 | | - |
| 2717 | | - |
| 2718 | | - |
| 2719 | | - |
| 2720 | if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ())| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2721 | { | - |
| 2722 | check_mail (); | - |
| 2723 | reset_mail_timer (); | - |
| 2724 | } never executed: end of block | 0 |
| 2725 | | - |
| 2726 | | - |
| 2727 | | - |
| 2728 | if (token_to_read == 0 && SHOULD_PROMPT ())| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2729 | prompt_again (); never executed: prompt_again (); | 0 |
| 2730 | } never executed: end of block | 0 |
| 2731 | | - |
| 2732 | two_tokens_ago = token_before_that; | - |
| 2733 | token_before_that = last_read_token; | - |
| 2734 | last_read_token = current_token; | - |
| 2735 | current_token = read_token (READ); | - |
| 2736 | | - |
| 2737 | if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token)| TRUE | evaluated 706586 times by 1 test | | FALSE | evaluated 4122846 times by 1 test |
| TRUE | evaluated 961 times by 1 test | | FALSE | evaluated 705625 times by 1 test |
| 961-4122846 |
| 2738 | { | - |
| 2739 | current_token = yacc_EOF; | - |
| 2740 | if (bash_input.type == st_string)| TRUE | evaluated 961 times by 1 test | | FALSE | never evaluated |
| 0-961 |
| 2741 | rewind_input_string ();executed 961 times by 1 test: rewind_input_string (); | 961 |
| 2742 | }executed 961 times by 1 test: end of block | 961 |
| 2743 | parser_state &= ~PST_EOFTOKEN; | - |
| 2744 | | - |
| 2745 | return (current_token);executed 4829432 times by 1 test: return (current_token); | 4829432 |
| 2746 | } | - |
| 2747 | | - |
| 2748 | | - |
| 2749 | | - |
| 2750 | static int esacs_needed_count; | - |
| 2751 | | - |
| 2752 | | - |
| 2753 | | - |
| 2754 | static int expecting_in_token; | - |
| 2755 | | - |
| 2756 | static void | - |
| 2757 | push_heredoc (r) | - |
| 2758 | REDIRECT *r; | - |
| 2759 | { | - |
| 2760 | if (need_here_doc >= HEREDOC_MAX)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1750 times by 1 test |
| 1-1750 |
| 2761 | { | - |
| 2762 | last_command_exit_value = EX_BADUSAGE; | - |
| 2763 | need_here_doc = 0; | - |
| 2764 | report_syntax_error (_("maximum here-document count exceeded")); | - |
| 2765 | reset_parser (); | - |
| 2766 | exit_shell (last_command_exit_value); | - |
| 2767 | } never executed: end of block | 0 |
| 2768 | redir_stack[need_here_doc++] = r; | - |
| 2769 | }executed 1750 times by 1 test: end of block | 1750 |
| 2770 | | - |
| 2771 | void | - |
| 2772 | gather_here_documents () | - |
| 2773 | { | - |
| 2774 | int r; | - |
| 2775 | | - |
| 2776 | r = 0; | - |
| 2777 | here_doc_first_line = 1; | - |
| 2778 | while (need_here_doc > 0)| TRUE | evaluated 1734 times by 1 test | | FALSE | evaluated 1730 times by 1 test |
| 1730-1734 |
| 2779 | { | - |
| 2780 | parser_state |= PST_HEREDOC; | - |
| 2781 | make_here_document (redir_stack[r++], line_number); | - |
| 2782 | parser_state &= ~PST_HEREDOC; | - |
| 2783 | need_here_doc--; | - |
| 2784 | redir_stack[r - 1] = 0; | - |
| 2785 | }executed 1734 times by 1 test: end of block | 1734 |
| 2786 | here_doc_first_line = 0; | - |
| 2787 | }executed 1730 times by 1 test: end of block | 1730 |
| 2788 | | - |
| 2789 | | - |
| 2790 | | - |
| 2791 | static int open_brace_count; | - |
| 2792 | | - |
| 2793 | | - |
| 2794 | | - |
| 2795 | | - |
| 2796 | | - |
| 2797 | | - |
| 2798 | #define parsing_redirection(token) \ | - |
| 2799 | (token == '<' || token == '>' || \ | - |
| 2800 | token == GREATER_GREATER || token == GREATER_BAR || \ | - |
| 2801 | token == LESS_GREATER || token == LESS_LESS_MINUS || \ | - |
| 2802 | token == LESS_LESS || token == LESS_LESS_LESS || \ | - |
| 2803 | token == LESS_AND || token == GREATER_AND || token == AND_GREATER) | - |
| 2804 | | - |
| 2805 | | - |
| 2806 | | - |
| 2807 | | - |
| 2808 | #define command_token_position(token) \ | - |
| 2809 | (((token) == ASSIGNMENT_WORD) || \ | - |
| 2810 | ((parser_state&PST_REDIRLIST) && parsing_redirection(token) == 0) || \ | - |
| 2811 | ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) | - |
| 2812 | | - |
| 2813 | | - |
| 2814 | #define assignment_acceptable(token) \ | - |
| 2815 | (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) | - |
| 2816 | | - |
| 2817 | | - |
| 2818 | | - |
| 2819 | #define CHECK_FOR_RESERVED_WORD(tok) \ | - |
| 2820 | do { \ | - |
| 2821 | if (!dollar_present && !quoted && \ | - |
| 2822 | reserved_word_acceptable (last_read_token)) \ | - |
| 2823 | { \ | - |
| 2824 | int i; \ | - |
| 2825 | for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ | - |
| 2826 | if (STREQ (tok, word_token_alist[i].word)) \ | - |
| 2827 | { \ | - |
| 2828 | if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ | - |
| 2829 | break; \ | - |
| 2830 | if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ | - |
| 2831 | break; \ | - |
| 2832 | if ((parser_state & PST_CASEPAT) && last_read_token == '|' && word_token_alist[i].token == ESAC) \ | - |
| 2833 | break; /* Posix grammar rule 4 */ \ | - |
| 2834 | if (word_token_alist[i].token == ESAC) \ | - |
| 2835 | parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ | - |
| 2836 | else if (word_token_alist[i].token == CASE) \ | - |
| 2837 | parser_state |= PST_CASESTMT; \ | - |
| 2838 | else if (word_token_alist[i].token == COND_END) \ | - |
| 2839 | parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ | - |
| 2840 | else if (word_token_alist[i].token == COND_START) \ | - |
| 2841 | parser_state |= PST_CONDCMD; \ | - |
| 2842 | else if (word_token_alist[i].token == '{') \ | - |
| 2843 | open_brace_count++; \ | - |
| 2844 | else if (word_token_alist[i].token == '}' && open_brace_count) \ | - |
| 2845 | open_brace_count--; \ | - |
| 2846 | return (word_token_alist[i].token); \ | - |
| 2847 | } \ | - |
| 2848 | } \ | - |
| 2849 | } while (0) | - |
| 2850 | | - |
| 2851 | #if defined (ALIAS) | - |
| 2852 | | - |
| 2853 | | - |
| 2854 | | - |
| 2855 | | - |
| 2856 | | - |
| 2857 | | - |
| 2858 | | - |
| 2859 | | - |
| 2860 | | - |
| 2861 | | - |
| 2862 | | - |
| 2863 | | - |
| 2864 | | - |
| 2865 | | - |
| 2866 | static char * | - |
| 2867 | mk_alexpansion (s) | - |
| 2868 | char *s; | - |
| 2869 | { | - |
| 2870 | int l; | - |
| 2871 | char *r; | - |
| 2872 | | - |
| 2873 | l = strlen (s); | - |
| 2874 | r = xmalloc (l + 2); | - |
| 2875 | strcpy (r, s); | - |
| 2876 | #ifdef OLD_ALIAS_HACK | - |
| 2877 | | - |
| 2878 | | - |
| 2879 | | - |
| 2880 | | - |
| 2881 | | - |
| 2882 | if (l > 0 && r[l - 1] != ' ' && r[l - 1] != '\n' && shellmeta(r[l - 1]) == 0) | - |
| 2883 | r[l++] = ' '; | - |
| 2884 | #endif | - |
| 2885 | r[l] = '\0'; | - |
| 2886 | return r;executed 82 times by 1 test: return r; | 82 |
| 2887 | } | - |
| 2888 | | - |
| 2889 | static int | - |
| 2890 | alias_expand_token (tokstr) | - |
| 2891 | char *tokstr; | - |
| 2892 | { | - |
| 2893 | char *expanded; | - |
| 2894 | alias_t *ap; | - |
| 2895 | | - |
| 2896 | if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) &&| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 16237 times by 1 test |
| TRUE | evaluated 54 times by 1 test | | FALSE | evaluated 16183 times by 1 test |
| TRUE | evaluated 13 times by 1 test | | FALSE | evaluated 16170 times by 1 test |
| TRUE | evaluated 13 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 13 times by 1 test |
| TRUE | evaluated 16170 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 16170 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 16170 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 7277 times by 1 test | | FALSE | evaluated 8893 times by 1 test |
| 0-16237 |
| 2897 | (parser_state & PST_CASEPAT) == 0)| TRUE | evaluated 7139 times by 1 test | | FALSE | evaluated 210 times by 1 test |
| 210-7139 |
| 2898 | { | - |
| 2899 | ap = find_alias (tokstr); | - |
| 2900 | | - |
| 2901 | | - |
| 2902 | if (ap && (ap->flags & AL_BEINGEXPANDED))| TRUE | evaluated 97 times by 1 test | | FALSE | evaluated 7042 times by 1 test |
| TRUE | evaluated 15 times by 1 test | | FALSE | evaluated 82 times by 1 test |
| 15-7042 |
| 2903 | return (NO_EXPANSION);executed 15 times by 1 test: return (-100); | 15 |
| 2904 | | - |
| 2905 | #ifdef OLD_ALIAS_HACK | - |
| 2906 | | - |
| 2907 | | - |
| 2908 | | - |
| 2909 | | - |
| 2910 | | - |
| 2911 | | - |
| 2912 | #endif | - |
| 2913 | expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL;| TRUE | evaluated 82 times by 1 test | | FALSE | evaluated 7042 times by 1 test |
| 82-7042 |
| 2914 | | - |
| 2915 | if (expanded)| TRUE | evaluated 82 times by 1 test | | FALSE | evaluated 7042 times by 1 test |
| 82-7042 |
| 2916 | { | - |
| 2917 | push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); | - |
| 2918 | return (RE_READ_TOKEN);executed 82 times by 1 test: return (-99); | 82 |
| 2919 | } | - |
| 2920 | else | - |
| 2921 | | - |
| 2922 | return (NO_EXPANSION);executed 7042 times by 1 test: return (-100); | 7042 |
| 2923 | } | - |
| 2924 | return (NO_EXPANSION);executed 9103 times by 1 test: return (-100); | 9103 |
| 2925 | } | - |
| 2926 | #endif /* ALIAS */ | - |
| 2927 | | - |
| 2928 | static int | - |
| 2929 | time_command_acceptable () | - |
| 2930 | { | - |
| 2931 | #if defined (COMMAND_TIMING) | - |
| 2932 | int i; | - |
| 2933 | | - |
| 2934 | if (posixly_correct && shell_compatibility_level > 41)| TRUE | never evaluated | | FALSE | evaluated 15 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-15 |
| 2935 | { | - |
| 2936 | | - |
| 2937 | | - |
| 2938 | | - |
| 2939 | i = shell_input_line_index; | - |
| 2940 | while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t'))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2941 | i++; never executed: i++; | 0 |
| 2942 | if (shell_input_line[i] == '-')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 2943 | return 0; never executed: return 0; | 0 |
| 2944 | } never executed: end of block | 0 |
| 2945 | | - |
| 2946 | switch (last_read_token) | - |
| 2947 | { | - |
| 2948 | case 0: never executed: case 0: | 0 |
| 2949 | case ';': never executed: case ';': | 0 |
| 2950 | case '\n':executed 6 times by 1 test: case '\n': | 6 |
| 2951 | if (token_before_that == '|')| TRUE | never evaluated | | FALSE | evaluated 6 times by 1 test |
| 0-6 |
| 2952 | return (0); never executed: return (0); | 0 |
| 2953 | | - |
| 2954 | case AND_AND:code before this statement executed 6 times by 1 test: case 288: never executed: case 288: | 0-6 |
| 2955 | case OR_OR: never executed: case 289: | 0 |
| 2956 | case '&': never executed: case '&': | 0 |
| 2957 | case WHILE: never executed: case 267: | 0 |
| 2958 | case DO: never executed: case 269: | 0 |
| 2959 | case UNTIL: never executed: case 268: | 0 |
| 2960 | case IF: never executed: case 258: | 0 |
| 2961 | case THEN: never executed: case 259: | 0 |
| 2962 | case ELIF: never executed: case 261: | 0 |
| 2963 | case ELSE: never executed: case 260: | 0 |
| 2964 | case '{': executed 5 times by 1 test: case '{': | 5 |
| 2965 | case '(': never executed: case '(': | 0 |
| 2966 | case ')': never executed: case ')': | 0 |
| 2967 | case BANG: executed 1 time by 1 test: case 277: | 1 |
| 2968 | case TIME: executed 2 times by 1 test: case 278: | 2 |
| 2969 | case TIMEOPT: executed 1 time by 1 test: case 279: | 1 |
| 2970 | case TIMEIGN: never executed: case 280: | 0 |
| 2971 | return 1;executed 15 times by 1 test: return 1; | 15 |
| 2972 | default: never executed: default: | 0 |
| 2973 | return 0; never executed: return 0; | 0 |
| 2974 | } | - |
| 2975 | #else | - |
| 2976 | return 0; | - |
| 2977 | #endif /* COMMAND_TIMING */ | - |
| 2978 | } | - |
| 2979 | | - |
| 2980 | | - |
| 2981 | | - |
| 2982 | | - |
| 2983 | | - |
| 2984 | | - |
| 2985 | | - |
| 2986 | | - |
| 2987 | | - |
| 2988 | | - |
| 2989 | | - |
| 2990 | | - |
| 2991 | | - |
| 2992 | | - |
| 2993 | | - |
| 2994 | | - |
| 2995 | | - |
| 2996 | | - |
| 2997 | | - |
| 2998 | | - |
| 2999 | | - |
| 3000 | | - |
| 3001 | | - |
| 3002 | | - |
| 3003 | | - |
| 3004 | | - |
| 3005 | | - |
| 3006 | static int | - |
| 3007 | special_case_tokens (tokstr) | - |
| 3008 | char *tokstr; | - |
| 3009 | { | - |
| 3010 | | - |
| 3011 | if ((last_read_token == WORD) &&| TRUE | evaluated 1185963 times by 1 test | | FALSE | evaluated 1661044 times by 1 test |
| 1185963-1661044 |
| 3012 | ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) &&| TRUE | evaluated 25656 times by 1 test | | FALSE | evaluated 1160307 times by 1 test |
| TRUE | evaluated 78110 times by 1 test | | FALSE | evaluated 1082197 times by 1 test |
| TRUE | evaluated 7 times by 1 test | | FALSE | evaluated 1082190 times by 1 test |
| 7-1160307 |
| 3013 | (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0))| TRUE | evaluated 103770 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| TRUE | evaluated 103770 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 103770 times by 1 test | | FALSE | never evaluated |
| 0-103770 |
| 3014 | { | - |
| 3015 | if (token_before_that == CASE)| TRUE | evaluated 78109 times by 1 test | | FALSE | evaluated 25661 times by 1 test |
| 25661-78109 |
| 3016 | { | - |
| 3017 | parser_state |= PST_CASEPAT; | - |
| 3018 | esacs_needed_count++; | - |
| 3019 | }executed 78109 times by 1 test: end of block | 78109 |
| 3020 | if (expecting_in_token)| TRUE | evaluated 103770 times by 1 test | | FALSE | never evaluated |
| 0-103770 |
| 3021 | expecting_in_token--;executed 103770 times by 1 test: expecting_in_token--; | 103770 |
| 3022 | return (IN);executed 103770 times by 1 test: return (276); | 103770 |
| 3023 | } | - |
| 3024 | | - |
| 3025 | | - |
| 3026 | | - |
| 3027 | | - |
| 3028 | if (expecting_in_token && (last_read_token == WORD || last_read_token == '\n') &&| TRUE | evaluated 9 times by 1 test | | FALSE | evaluated 2743228 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 6 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 2-2743228 |
| 3029 | (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0))| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-3 |
| 3030 | { | - |
| 3031 | if (parser_state & PST_CASESTMT)| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 3032 | { | - |
| 3033 | parser_state |= PST_CASEPAT; | - |
| 3034 | esacs_needed_count++; | - |
| 3035 | }executed 2 times by 1 test: end of block | 2 |
| 3036 | expecting_in_token--; | - |
| 3037 | return (IN);executed 2 times by 1 test: return (276); | 2 |
| 3038 | } | - |
| 3039 | | - |
| 3040 | else if (expecting_in_token && (last_read_token == '\n' || last_read_token == ';') &&| TRUE | evaluated 7 times by 1 test | | FALSE | evaluated 2743228 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 7 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| 0-2743228 |
| 3041 | (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0'))| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-4 |
| 3042 | { | - |
| 3043 | expecting_in_token--; | - |
| 3044 | return (DO);executed 4 times by 1 test: return (269); | 4 |
| 3045 | } | - |
| 3046 | | - |
| 3047 | | - |
| 3048 | if (last_read_token == WORD &&| TRUE | evaluated 1082193 times by 1 test | | FALSE | evaluated 1661038 times by 1 test |
| 1082193-1661038 |
| 3049 | #if defined (SELECT_COMMAND) | - |
| 3050 | (token_before_that == FOR || token_before_that == SELECT) &&| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1082192 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1082191 times by 1 test |
| 1-1082192 |
| 3051 | #else | - |
| 3052 | (token_before_that == FOR) && | - |
| 3053 | #endif | - |
| 3054 | (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0'))| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 3055 | { | - |
| 3056 | if (expecting_in_token)| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 3057 | expecting_in_token--;executed 2 times by 1 test: expecting_in_token--; | 2 |
| 3058 | return (DO);executed 2 times by 1 test: return (269); | 2 |
| 3059 | } | - |
| 3060 | | - |
| 3061 | | - |
| 3062 | | - |
| 3063 | | - |
| 3064 | | - |
| 3065 | | - |
| 3066 | | - |
| 3067 | if (esacs_needed_count)| TRUE | evaluated 904463 times by 1 test | | FALSE | evaluated 1838766 times by 1 test |
| 904463-1838766 |
| 3068 | { | - |
| 3069 | if (last_read_token == IN && STREQ (tokstr, "esac")) never executed: __result = (((const unsigned char *) (const char *) ( tokstr ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "esac" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | evaluated 23251 times by 1 test | | FALSE | evaluated 881212 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 23249 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-881212 |
| 3070 | { | - |
| 3071 | esacs_needed_count--; | - |
| 3072 | parser_state &= ~PST_CASEPAT; | - |
| 3073 | return (ESAC);executed 2 times by 1 test: return (264); | 2 |
| 3074 | } | - |
| 3075 | }executed 904461 times by 1 test: end of block | 904461 |
| 3076 | | - |
| 3077 | | - |
| 3078 | if (parser_state & PST_ALLOWOPNBRC)| TRUE | evaluated 11217 times by 1 test | | FALSE | evaluated 2732010 times by 1 test |
| 11217-2732010 |
| 3079 | { | - |
| 3080 | parser_state &= ~PST_ALLOWOPNBRC; | - |
| 3081 | if (tokstr[0] == '{' && tokstr[1] == '\0') | TRUE | evaluated 11201 times by 1 test | | FALSE | evaluated 16 times by 1 test |
| TRUE | evaluated 11201 times by 1 test | | FALSE | never evaluated |
| 0-11201 |
| 3082 | { | - |
| 3083 | open_brace_count++; | - |
| 3084 | function_bstart = line_number; | - |
| 3085 | return ('{'); executed 11201 times by 1 test: return ('{'); | 11201 |
| 3086 | } | - |
| 3087 | }executed 16 times by 1 test: end of block | 16 |
| 3088 | | - |
| 3089 | | - |
| 3090 | | - |
| 3091 | if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2])| TRUE | evaluated 402 times by 1 test | | FALSE | evaluated 2731624 times by 1 test |
| TRUE | evaluated 201 times by 1 test | | FALSE | evaluated 201 times by 1 test |
| TRUE | evaluated 201 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 201 times by 1 test | | FALSE | never evaluated |
| 0-2731624 |
| 3092 | return (DO);executed 201 times by 1 test: return (269); | 201 |
| 3093 | if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') | TRUE | evaluated 201 times by 1 test | | FALSE | evaluated 2731624 times by 1 test |
| TRUE | evaluated 201 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 201 times by 1 test | | FALSE | never evaluated |
| 0-2731624 |
| 3094 | { | - |
| 3095 | open_brace_count++; | - |
| 3096 | return ('{'); executed 201 times by 1 test: return ('{'); | 201 |
| 3097 | } | - |
| 3098 | | - |
| 3099 | if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1])| TRUE | evaluated 490215 times by 1 test | | FALSE | evaluated 2241409 times by 1 test |
| TRUE | evaluated 351427 times by 1 test | | FALSE | evaluated 138788 times by 1 test |
| TRUE | evaluated 12223 times by 1 test | | FALSE | evaluated 339204 times by 1 test |
| TRUE | evaluated 12223 times by 1 test | | FALSE | never evaluated |
| 0-2241409 |
| 3100 | { | - |
| 3101 | open_brace_count--; | - |
| 3102 | return ('}');executed 12223 times by 1 test: return ('}'); | 12223 |
| 3103 | } | - |
| 3104 | | - |
| 3105 | #if defined (COMMAND_TIMING) | - |
| 3106 | | - |
| 3107 | if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2])| TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 2719387 times by 1 test |
| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 6 times by 1 test |
| TRUE | evaluated 8 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 8 times by 1 test | | FALSE | never evaluated |
| 0-2719387 |
| 3108 | return (TIMEOPT);executed 8 times by 1 test: return (279); | 8 |
| 3109 | | - |
| 3110 | if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2])| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 2719385 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 7 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-2719385 |
| 3111 | return (TIMEIGN);executed 1 time by 1 test: return (280); | 1 |
| 3112 | #endif | - |
| 3113 | | - |
| 3114 | #if defined (COND_COMMAND) /* [[ */ | - |
| 3115 | if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0')| TRUE | evaluated 2338 times by 1 test | | FALSE | evaluated 2717054 times by 1 test |
| TRUE | evaluated 574 times by 1 test | | FALSE | evaluated 1764 times by 1 test |
| TRUE | evaluated 574 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 574 times by 1 test | | FALSE | never evaluated |
| 0-2717054 |
| 3116 | return (COND_END);executed 574 times by 1 test: return (274); | 574 |
| 3117 | #endif | - |
| 3118 | | - |
| 3119 | return (-1);executed 2718818 times by 1 test: return (-1); | 2718818 |
| 3120 | } | - |
| 3121 | | - |
| 3122 | | - |
| 3123 | | - |
| 3124 | void | - |
| 3125 | reset_parser () | - |
| 3126 | { | - |
| 3127 | dstack.delimiter_depth = 0; | - |
| 3128 | open_brace_count = 0; | - |
| 3129 | | - |
| 3130 | #if defined (EXTENDED_GLOB) | - |
| 3131 | | - |
| 3132 | if (parser_state & PST_EXTPAT)| TRUE | never evaluated | | FALSE | evaluated 705454 times by 1 test |
| 0-705454 |
| 3133 | extended_glob = global_extglob; never executed: extended_glob = global_extglob; | 0 |
| 3134 | #endif | - |
| 3135 | | - |
| 3136 | parser_state = 0; | - |
| 3137 | here_doc_first_line = 0; | - |
| 3138 | | - |
| 3139 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 3140 | if (pushed_string_list)| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 705452 times by 1 test |
| 2-705452 |
| 3141 | free_string_list ();executed 2 times by 1 test: free_string_list (); | 2 |
| 3142 | #endif /* ALIAS || DPAREN_ARITHMETIC */ | - |
| 3143 | | - |
| 3144 | | - |
| 3145 | if (shell_input_line)| TRUE | evaluated 705447 times by 1 test | | FALSE | evaluated 7 times by 1 test |
| 7-705447 |
| 3146 | { | - |
| 3147 | free (shell_input_line); | - |
| 3148 | shell_input_line = (char *)NULL; | - |
| 3149 | shell_input_line_size = shell_input_line_index = 0; | - |
| 3150 | }executed 705447 times by 1 test: end of block | 705447 |
| 3151 | | - |
| 3152 | FREE (word_desc_to_read); never executed: sh_xfree((word_desc_to_read), "./parse.y", 3152); | TRUE | never evaluated | | FALSE | evaluated 705454 times by 1 test |
| 0-705454 |
| 3153 | word_desc_to_read = (WORD_DESC *)NULL; | - |
| 3154 | | - |
| 3155 | eol_ungetc_lookahead = 0; | - |
| 3156 | | - |
| 3157 | current_token = '\n'; | - |
| 3158 | last_read_token = '\n'; | - |
| 3159 | token_to_read = '\n'; | - |
| 3160 | }executed 705454 times by 1 test: end of block | 705454 |
| 3161 | | - |
| 3162 | | - |
| 3163 | | - |
| 3164 | static int | - |
| 3165 | read_token (command) | - |
| 3166 | int command; | - |
| 3167 | { | - |
| 3168 | int character; | - |
| 3169 | int peek_char; | - |
| 3170 | int result; | - |
| 3171 | | - |
| 3172 | if (command == RESET)| TRUE | never evaluated | | FALSE | evaluated 4839811 times by 1 test |
| 0-4839811 |
| 3173 | { | - |
| 3174 | reset_parser (); | - |
| 3175 | return ('\n'); never executed: return ('\n'); | 0 |
| 3176 | } | - |
| 3177 | | - |
| 3178 | if (token_to_read)| TRUE | evaluated 720 times by 1 test | | FALSE | evaluated 4839091 times by 1 test |
| 720-4839091 |
| 3179 | { | - |
| 3180 | result = token_to_read; | - |
| 3181 | if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD)| TRUE | never evaluated | | FALSE | evaluated 720 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 720 times by 1 test |
| 0-720 |
| 3182 | { | - |
| 3183 | yylval.word = word_desc_to_read; | - |
| 3184 | word_desc_to_read = (WORD_DESC *)NULL; | - |
| 3185 | } never executed: end of block | 0 |
| 3186 | token_to_read = 0; | - |
| 3187 | return (result);executed 720 times by 1 test: return (result); | 720 |
| 3188 | } | - |
| 3189 | | - |
| 3190 | #if defined (COND_COMMAND) | - |
| 3191 | if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD)| TRUE | evaluated 574 times by 1 test | | FALSE | evaluated 4838517 times by 1 test |
| 574-4838517 |
| 3192 | { | - |
| 3193 | cond_lineno = line_number; | - |
| 3194 | parser_state |= PST_CONDEXPR; | - |
| 3195 | yylval.command = parse_cond_command (); | - |
| 3196 | if (cond_token != COND_END)| TRUE | never evaluated | | FALSE | evaluated 574 times by 1 test |
| 0-574 |
| 3197 | { | - |
| 3198 | cond_error (); | - |
| 3199 | return (-1); never executed: return (-1); | 0 |
| 3200 | } | - |
| 3201 | token_to_read = COND_END; | - |
| 3202 | parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); | - |
| 3203 | return (COND_CMD);executed 574 times by 1 test: return (287); | 574 |
| 3204 | } | - |
| 3205 | #endif | - |
| 3206 | | - |
| 3207 | #if defined (ALIAS) | - |
| 3208 | | - |
| 3209 | | - |
| 3210 | re_read_token:code before this statement executed 4838517 times by 1 test: re_read_token: | 4838517 |
| 3211 | #endif /* ALIAS */ | - |
| 3212 | | - |
| 3213 | | - |
| 3214 | while ((character = shell_getc (1)) != EOF && shellblank (character))| TRUE | evaluated 8083881 times by 1 test | | FALSE | evaluated 361 times by 1 test |
| TRUE | evaluated 3245643 times by 1 test | | FALSE | evaluated 4838238 times by 1 test |
| 361-8083881 |
| 3215 | ;executed 3245643 times by 1 test: ; | 3245643 |
| 3216 | | - |
| 3217 | if (character == EOF)| TRUE | evaluated 361 times by 1 test | | FALSE | evaluated 4838238 times by 1 test |
| 361-4838238 |
| 3218 | { | - |
| 3219 | EOF_Reached = 1; | - |
| 3220 | return (yacc_EOF);executed 361 times by 1 test: return (304); | 361 |
| 3221 | } | - |
| 3222 | | - |
| 3223 | | - |
| 3224 | | - |
| 3225 | if (character == '\0' && bash_input.type == st_string && expanding_alias() == 0)| TRUE | never evaluated | | FALSE | evaluated 4838238 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-4838238 |
| 3226 | { | - |
| 3227 | #if defined (DEBUG) | - |
| 3228 | itrace("shell_getc: bash_input.location.string = `%s'", bash_input.location.string); | - |
| 3229 | #endif | - |
| 3230 | EOF_Reached = 1; | - |
| 3231 | return (yacc_EOF); never executed: return (304); | 0 |
| 3232 | } | - |
| 3233 | | - |
| 3234 | if MBTEST(character == '#' && (!interactive || interactive_comments))| TRUE | evaluated 1465 times by 1 test | | FALSE | evaluated 34011 times by 1 test |
| TRUE | evaluated 35476 times by 1 test | | FALSE | evaluated 4802762 times by 1 test |
| TRUE | evaluated 35476 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 35476 times by 1 test | | FALSE | never evaluated |
| 0-4802762 |
| 3235 | { | - |
| 3236 | | - |
| 3237 | discard_until ('\n'); | - |
| 3238 | shell_getc (0); | - |
| 3239 | character = '\n'; | - |
| 3240 | }executed 35476 times by 1 test: end of block | 35476 |
| 3241 | | - |
| 3242 | if (character == '\n')| TRUE | evaluated 716846 times by 1 test | | FALSE | evaluated 4121392 times by 1 test |
| 716846-4121392 |
| 3243 | { | - |
| 3244 | | - |
| 3245 | | - |
| 3246 | if (need_here_doc)| TRUE | evaluated 1726 times by 1 test | | FALSE | evaluated 715120 times by 1 test |
| 1726-715120 |
| 3247 | gather_here_documents ();executed 1726 times by 1 test: gather_here_documents (); | 1726 |
| 3248 | | - |
| 3249 | #if defined (ALIAS) | - |
| 3250 | parser_state &= ~PST_ALEXPNEXT; | - |
| 3251 | #endif /* ALIAS */ | - |
| 3252 | | - |
| 3253 | parser_state &= ~PST_ASSIGNOK; | - |
| 3254 | | - |
| 3255 | return (character);executed 716846 times by 1 test: return (character); | 716846 |
| 3256 | } | - |
| 3257 | | - |
| 3258 | if (parser_state & PST_REGEXP)| TRUE | evaluated 91 times by 1 test | | FALSE | evaluated 4121301 times by 1 test |
| 91-4121301 |
| 3259 | goto tokword;executed 91 times by 1 test: goto tokword; | 91 |
| 3260 | | - |
| 3261 | | - |
| 3262 | if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0))| TRUE | evaluated 1257549 times by 1 test | | FALSE | evaluated 4739 times by 1 test |
| TRUE | evaluated 1262288 times by 1 test | | FALSE | evaluated 2859013 times by 1 test |
| TRUE | evaluated 1262288 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1262288 times by 1 test | | FALSE | never evaluated |
| 0-2859013 |
| 3263 | { | - |
| 3264 | #if defined (ALIAS) | - |
| 3265 | | - |
| 3266 | | - |
| 3267 | if (character == '<' || character == '>')| TRUE | evaluated 18723 times by 1 test | | FALSE | evaluated 1243565 times by 1 test |
| TRUE | evaluated 35988 times by 1 test | | FALSE | evaluated 1207577 times by 1 test |
| 18723-1243565 |
| 3268 | parser_state &= ~PST_ALEXPNEXT;executed 54711 times by 1 test: parser_state &= ~0x000002; | 54711 |
| 3269 | #endif /* ALIAS */ | - |
| 3270 | | - |
| 3271 | parser_state &= ~PST_ASSIGNOK; | - |
| 3272 | | - |
| 3273 | | - |
| 3274 | | - |
| 3275 | | - |
| 3276 | | - |
| 3277 | | - |
| 3278 | if ((parser_state & PST_CMDSUBST) && character == shell_eof_token)| TRUE | evaluated 791139 times by 1 test | | FALSE | evaluated 471149 times by 1 test |
| TRUE | evaluated 705861 times by 1 test | | FALSE | evaluated 85278 times by 1 test |
| 85278-791139 |
| 3279 | peek_char = shell_getc (0);executed 705861 times by 1 test: peek_char = shell_getc (0); | 705861 |
| 3280 | else | - |
| 3281 | peek_char = shell_getc (1);executed 556427 times by 1 test: peek_char = shell_getc (1); | 556427 |
| 3282 | | - |
| 3283 | if (character == peek_char)| TRUE | evaluated 229852 times by 1 test | | FALSE | evaluated 1032436 times by 1 test |
| 229852-1032436 |
| 3284 | { | - |
| 3285 | switch (character) | - |
| 3286 | { | - |
| 3287 | case '<':executed 1816 times by 1 test: case '<': | 1816 |
| 3288 | | - |
| 3289 | | - |
| 3290 | peek_char = shell_getc (1); | - |
| 3291 | if MBTEST(peek_char == '-')| TRUE | evaluated 38 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 38 times by 1 test | | FALSE | evaluated 1778 times by 1 test |
| TRUE | evaluated 38 times by 1 test | | FALSE | never evaluated |
| 0-1778 |
| 3292 | return (LESS_LESS_MINUS);executed 38 times by 1 test: return (298); | 38 |
| 3293 | else if MBTEST(peek_char == '<')| TRUE | evaluated 65 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 65 times by 1 test | | FALSE | evaluated 1713 times by 1 test |
| TRUE | evaluated 65 times by 1 test | | FALSE | never evaluated |
| 0-1713 |
| 3294 | return (LESS_LESS_LESS);executed 65 times by 1 test: return (293); | 65 |
| 3295 | else | - |
| 3296 | { | - |
| 3297 | shell_ungetc (peek_char); | - |
| 3298 | return (LESS_LESS);executed 1713 times by 1 test: return (291); | 1713 |
| 3299 | } | - |
| 3300 | | - |
| 3301 | case '>':executed 33 times by 1 test: case '>': | 33 |
| 3302 | return (GREATER_GREATER);executed 33 times by 1 test: return (290); | 33 |
| 3303 | | - |
| 3304 | case ';':executed 155759 times by 1 test: case ';': | 155759 |
| 3305 | parser_state |= PST_CASEPAT; | - |
| 3306 | #if defined (ALIAS) | - |
| 3307 | parser_state &= ~PST_ALEXPNEXT; | - |
| 3308 | #endif /* ALIAS */ | - |
| 3309 | | - |
| 3310 | peek_char = shell_getc (1); | - |
| 3311 | if MBTEST(peek_char == '&')| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 155757 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-155757 |
| 3312 | return (SEMI_SEMI_AND);executed 2 times by 1 test: return (297); | 2 |
| 3313 | else | - |
| 3314 | { | - |
| 3315 | shell_ungetc (peek_char); | - |
| 3316 | return (SEMI_SEMI);executed 155757 times by 1 test: return (295); | 155757 |
| 3317 | } | - |
| 3318 | | - |
| 3319 | case '&':executed 700 times by 1 test: case '&': | 700 |
| 3320 | return (AND_AND);executed 700 times by 1 test: return (288); | 700 |
| 3321 | | - |
| 3322 | case '|':executed 21714 times by 1 test: case '|': | 21714 |
| 3323 | return (OR_OR);executed 21714 times by 1 test: return (289); | 21714 |
| 3324 | | - |
| 3325 | #if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) | - |
| 3326 | case '(': executed 49738 times by 1 test: case '(': | 49738 |
| 3327 | result = parse_dparen (character); | - |
| 3328 | if (result == -2)| TRUE | never evaluated | | FALSE | evaluated 49738 times by 1 test |
| 0-49738 |
| 3329 | break; never executed: break; | 0 |
| 3330 | else | - |
| 3331 | return result;executed 49738 times by 1 test: return result; | 49738 |
| 3332 | #endif | - |
| 3333 | } | - |
| 3334 | }executed 92 times by 1 test: end of block | 92 |
| 3335 | else if MBTEST(character == '<' && peek_char == '&')| TRUE | evaluated 76 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 16907 times by 1 test | | FALSE | evaluated 1015529 times by 1 test |
| TRUE | evaluated 76 times by 1 test | | FALSE | evaluated 16831 times by 1 test |
| TRUE | evaluated 76 times by 1 test | | FALSE | never evaluated |
| 0-1015529 |
| 3336 | return (LESS_AND);executed 76 times by 1 test: return (292); | 76 |
| 3337 | else if MBTEST(character == '>' && peek_char == '&')| TRUE | evaluated 22403 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 35955 times by 1 test | | FALSE | evaluated 996405 times by 1 test |
| TRUE | evaluated 22403 times by 1 test | | FALSE | evaluated 13552 times by 1 test |
| TRUE | evaluated 22403 times by 1 test | | FALSE | never evaluated |
| 0-996405 |
| 3338 | return (GREATER_AND);executed 22403 times by 1 test: return (294); | 22403 |
| 3339 | else if MBTEST(character == '<' && peek_char == '>')| TRUE | evaluated 20 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 16831 times by 1 test | | FALSE | evaluated 993126 times by 1 test |
| TRUE | evaluated 20 times by 1 test | | FALSE | evaluated 16811 times by 1 test |
| TRUE | evaluated 20 times by 1 test | | FALSE | never evaluated |
| 0-993126 |
| 3340 | return (LESS_GREATER);executed 20 times by 1 test: return (301); | 20 |
| 3341 | else if MBTEST(character == '>' && peek_char == '|')| TRUE | evaluated 19 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 13552 times by 1 test | | FALSE | evaluated 996385 times by 1 test |
| TRUE | evaluated 19 times by 1 test | | FALSE | evaluated 13533 times by 1 test |
| TRUE | evaluated 19 times by 1 test | | FALSE | never evaluated |
| 0-996385 |
| 3342 | return (GREATER_BAR);executed 19 times by 1 test: return (302); | 19 |
| 3343 | else if MBTEST(character == '&' && peek_char == '>')| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 346 times by 1 test | | FALSE | evaluated 1009572 times by 1 test |
| TRUE | evaluated 22 times by 1 test | | FALSE | evaluated 324 times by 1 test |
| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| 0-1009572 |
| 3344 | { | - |
| 3345 | peek_char = shell_getc (1); | - |
| 3346 | if MBTEST(peek_char == '>')| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 18 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-18 |
| 3347 | return (AND_GREATER_GREATER);executed 4 times by 1 test: return (300); | 4 |
| 3348 | else | - |
| 3349 | { | - |
| 3350 | shell_ungetc (peek_char); | - |
| 3351 | return (AND_GREATER);executed 18 times by 1 test: return (299); | 18 |
| 3352 | } | - |
| 3353 | } | - |
| 3354 | else if MBTEST(character == '|' && peek_char == '&')| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 20453 times by 1 test | | FALSE | evaluated 989443 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 20451 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-989443 |
| 3355 | return (BAR_AND);executed 2 times by 1 test: return (303); | 2 |
| 3356 | else if MBTEST(character == ';' && peek_char == '&')| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 59362 times by 1 test | | FALSE | evaluated 950532 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 59358 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-950532 |
| 3357 | { | - |
| 3358 | parser_state |= PST_CASEPAT; | - |
| 3359 | #if defined (ALIAS) | - |
| 3360 | parser_state &= ~PST_ALEXPNEXT; | - |
| 3361 | #endif /* ALIAS */ | - |
| 3362 | return (SEMI_AND);executed 4 times by 1 test: return (296); | 4 |
| 3363 | } | - |
| 3364 | | - |
| 3365 | shell_ungetc (peek_char); | - |
| 3366 | | - |
| 3367 | | - |
| 3368 | | - |
| 3369 | | - |
| 3370 | if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD)| TRUE | evaluated 11196 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 881455 times by 1 test | | FALSE | evaluated 128527 times by 1 test |
| TRUE | evaluated 11196 times by 1 test | | FALSE | evaluated 870259 times by 1 test |
| TRUE | evaluated 11196 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 11196 times by 1 test | | FALSE | never evaluated |
| 0-881455 |
| 3371 | { | - |
| 3372 | parser_state |= PST_ALLOWOPNBRC; | - |
| 3373 | #if defined (ALIAS) | - |
| 3374 | parser_state &= ~PST_ALEXPNEXT; | - |
| 3375 | #endif /* ALIAS */ | - |
| 3376 | function_dstart = line_number; | - |
| 3377 | }executed 11196 times by 1 test: end of block | 11196 |
| 3378 | | - |
| 3379 | | - |
| 3380 | | - |
| 3381 | | - |
| 3382 | if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) | TRUE | evaluated 15684 times by 1 test | | FALSE | evaluated 1482 times by 1 test |
| TRUE | evaluated 18050 times by 1 test | | FALSE | evaluated 991932 times by 1 test |
| TRUE | evaluated 17166 times by 1 test | | FALSE | evaluated 884 times by 1 test |
| TRUE | evaluated 17166 times by 1 test | | FALSE | never evaluated |
| 0-991932 |
| 3383 | parser_state |= PST_SUBSHELL;executed 17166 times by 1 test: parser_state |= 0x000020; | 17166 |
| 3384 | | - |
| 3385 | else if MBTEST((parser_state & PST_CASEPAT) && character == ')')| TRUE | evaluated 158270 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 165984 times by 1 test | | FALSE | evaluated 826832 times by 1 test |
| TRUE | evaluated 158270 times by 1 test | | FALSE | evaluated 7714 times by 1 test |
| TRUE | evaluated 158270 times by 1 test | | FALSE | never evaluated |
| 0-826832 |
| 3386 | parser_state &= ~PST_CASEPAT;executed 158270 times by 1 test: parser_state &= ~0x000001; | 158270 |
| 3387 | | - |
| 3388 | else if MBTEST((parser_state & PST_SUBSHELL) && character == ')')| TRUE | evaluated 17118 times by 1 test | | FALSE | evaluated 37 times by 1 test |
| TRUE | evaluated 23071 times by 1 test | | FALSE | evaluated 811475 times by 1 test |
| TRUE | evaluated 17155 times by 1 test | | FALSE | evaluated 5916 times by 1 test |
| TRUE | evaluated 17155 times by 1 test | | FALSE | never evaluated |
| 0-811475 |
| 3389 | parser_state &= ~PST_SUBSHELL;executed 17155 times by 1 test: parser_state &= ~0x000020; | 17155 |
| 3390 | | - |
| 3391 | #if defined (PROCESS_SUBSTITUTION) | - |
| 3392 | | - |
| 3393 | | - |
| 3394 | if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) | TRUE | evaluated 991438 times by 1 test | | FALSE | evaluated 2368 times by 1 test |
| TRUE | evaluated 2870 times by 1 test | | FALSE | evaluated 1007112 times by 1 test |
| TRUE | evaluated 993589 times by 1 test | | FALSE | evaluated 13523 times by 1 test |
| TRUE | evaluated 976789 times by 1 test | | FALSE | evaluated 16800 times by 1 test |
| TRUE | evaluated 14147 times by 1 test | | FALSE | evaluated 16176 times by 1 test |
| TRUE | evaluated 993806 times by 1 test | | FALSE | never evaluated |
| 0-1007112 |
| 3395 | #endif /* PROCESS_SUBSTITUTION */ | - |
| 3396 | return (character);executed 993806 times by 1 test: return (character); | 993806 |
| 3397 | }executed 16176 times by 1 test: end of block | 16176 |
| 3398 | | - |
| 3399 | | - |
| 3400 | if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND))| TRUE | evaluated 1052 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 32825 times by 1 test | | FALSE | evaluated 2842364 times by 1 test |
| TRUE | evaluated 26 times by 1 test | | FALSE | evaluated 32799 times by 1 test |
| TRUE | evaluated 1026 times by 1 test | | FALSE | evaluated 31773 times by 1 test |
| TRUE | evaluated 1052 times by 1 test | | FALSE | never evaluated |
| 0-2842364 |
| 3401 | return (character);executed 1052 times by 1 test: return (character); | 1052 |
| 3402 | | - |
| 3403 | tokword:code before this statement executed 2874137 times by 1 test: tokword: | 2874137 |
| 3404 | | - |
| 3405 | | - |
| 3406 | result = read_token_word (character); | - |
| 3407 | #if defined (ALIAS) | - |
| 3408 | if (result == RE_READ_TOKEN)| TRUE | evaluated 82 times by 1 test | | FALSE | evaluated 2874129 times by 1 test |
| 82-2874129 |
| 3409 | goto re_read_token;executed 82 times by 1 test: goto re_read_token; | 82 |
| 3410 | #endif | - |
| 3411 | return result;executed 2874129 times by 1 test: return result; | 2874129 |
| 3412 | } | - |
| 3413 | | - |
| 3414 | | - |
| 3415 | | - |
| 3416 | | - |
| 3417 | | - |
| 3418 | | - |
| 3419 | | - |
| 3420 | #define P_FIRSTCLOSE 0x0001 | - |
| 3421 | #define P_ALLOWESC 0x0002 | - |
| 3422 | #define P_DQUOTE 0x0004 | - |
| 3423 | #define P_COMMAND 0x0008 /* parsing a command, so look for comments */ | - |
| 3424 | #define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ | - |
| 3425 | #define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ | - |
| 3426 | #define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ | - |
| 3427 | | - |
| 3428 | | - |
| 3429 | #define LEX_WASDOL 0x0001 | - |
| 3430 | #define LEX_CKCOMMENT 0x0002 | - |
| 3431 | #define LEX_INCOMMENT 0x0004 | - |
| 3432 | #define LEX_PASSNEXT 0x0008 | - |
| 3433 | #define LEX_RESWDOK 0x0010 | - |
| 3434 | #define LEX_CKCASE 0x0020 | - |
| 3435 | #define LEX_INCASE 0x0040 | - |
| 3436 | #define LEX_INHEREDOC 0x0080 | - |
| 3437 | #define LEX_HEREDELIM 0x0100 /* reading here-doc delimiter */ | - |
| 3438 | #define LEX_STRIPDOC 0x0200 /* <<- strip tabs from here doc delim */ | - |
| 3439 | #define LEX_QUOTEDDOC 0x0400 /* here doc with quoted delim */ | - |
| 3440 | #define LEX_INWORD 0x0800 | - |
| 3441 | #define LEX_GTLT 0x1000 | - |
| 3442 | | - |
| 3443 | #define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') | - |
| 3444 | | - |
| 3445 | #define CHECK_NESTRET_ERROR() \ | - |
| 3446 | do { \ | - |
| 3447 | if (nestret == &matched_pair_error) \ | - |
| 3448 | { \ | - |
| 3449 | free (ret); \ | - |
| 3450 | return &matched_pair_error; \ | - |
| 3451 | } \ | - |
| 3452 | } while (0) | - |
| 3453 | | - |
| 3454 | #define APPEND_NESTRET() \ | - |
| 3455 | do { \ | - |
| 3456 | if (nestlen) \ | - |
| 3457 | { \ | - |
| 3458 | RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ | - |
| 3459 | strcpy (ret + retind, nestret); \ | - |
| 3460 | retind += nestlen; \ | - |
| 3461 | } \ | - |
| 3462 | } while (0) | - |
| 3463 | | - |
| 3464 | static char matched_pair_error; | - |
| 3465 | | - |
| 3466 | static char * | - |
| 3467 | parse_matched_pair (qc, open, close, lenp, flags) | - |
| 3468 | int qc; | - |
| 3469 | int open, close; | - |
| 3470 | int *lenp, flags; | - |
| 3471 | { | - |
| 3472 | int count, ch, prevch, tflags; | - |
| 3473 | int nestlen, ttranslen, start_lineno; | - |
| 3474 | char *ret, *nestret, *ttrans; | - |
| 3475 | int retind, retsize, rflags; | - |
| 3476 | int dolbrace_state; | - |
| 3477 | | - |
| 3478 | dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0;| TRUE | evaluated 23686 times by 1 test | | FALSE | evaluated 435060 times by 1 test |
| 23686-435060 |
| 3479 | | - |
| 3480 | | - |
| 3481 | count = 1; | - |
| 3482 | tflags = 0; | - |
| 3483 | | - |
| 3484 | if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0)| TRUE | evaluated 26230 times by 1 test | | FALSE | evaluated 432516 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 26230 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-432516 |
| 3485 | tflags |= LEX_CKCOMMENT; never executed: tflags |= 0x0002; | 0 |
| 3486 | | - |
| 3487 | | - |
| 3488 | rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE);| TRUE | evaluated 152909 times by 1 test | | FALSE | evaluated 305837 times by 1 test |
| 152909-305837 |
| 3489 | | - |
| 3490 | ret = (char *)xmalloc (retsize = 64); | - |
| 3491 | retind = 0; | - |
| 3492 | | - |
| 3493 | start_lineno = line_number; | - |
| 3494 | ch = EOF; | - |
| 3495 | while (count)| TRUE | evaluated 3944688 times by 1 test | | FALSE | never evaluated |
| 0-3944688 |
| 3496 | { | - |
| 3497 | prevch = ch; | - |
| 3498 | ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); | - |
| 3499 | | - |
| 3500 | if (ch == EOF)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 3944687 times by 1 test |
| 1-3944687 |
| 3501 | { | - |
| 3502 | free (ret); | - |
| 3503 | parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); | - |
| 3504 | EOF_Reached = 1; | - |
| 3505 | return (&matched_pair_error);executed 1 time by 1 test: return (&matched_pair_error); | 1 |
| 3506 | } | - |
| 3507 | | - |
| 3508 | | - |
| 3509 | if (ch == '\n' && SHOULD_PROMPT ())| TRUE | evaluated 2641 times by 1 test | | FALSE | evaluated 3942046 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 2641 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-3942046 |
| 3510 | prompt_again (); never executed: prompt_again (); | 0 |
| 3511 | | - |
| 3512 | | - |
| 3513 | | - |
| 3514 | if (tflags & LEX_INCOMMENT)| TRUE | never evaluated | | FALSE | evaluated 3944687 times by 1 test |
| 0-3944687 |
| 3515 | { | - |
| 3516 | | - |
| 3517 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3518 | ret[retind++] = ch; | - |
| 3519 | | - |
| 3520 | if (ch == '\n')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3521 | tflags &= ~LEX_INCOMMENT; never executed: tflags &= ~0x0004; | 0 |
| 3522 | | - |
| 3523 | continue; never executed: continue; | 0 |
| 3524 | } | - |
| 3525 | | - |
| 3526 | | - |
| 3527 | | - |
| 3528 | | - |
| 3529 | else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1])))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 3944687 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-3944687 |
| 3530 | tflags |= LEX_INCOMMENT; never executed: tflags |= 0x0004; | 0 |
| 3531 | | - |
| 3532 | if (tflags & LEX_PASSNEXT) | TRUE | evaluated 158319 times by 1 test | | FALSE | evaluated 3786368 times by 1 test |
| 158319-3786368 |
| 3533 | { | - |
| 3534 | tflags &= ~LEX_PASSNEXT; | - |
| 3535 | if (qc != '\'' && ch == '\n') | TRUE | evaluated 153494 times by 1 test | | FALSE | evaluated 4825 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 153494 times by 1 test |
| 0-153494 |
| 3536 | { | - |
| 3537 | if (retind > 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3538 | retind--; never executed: retind--; | 0 |
| 3539 | continue; never executed: continue; | 0 |
| 3540 | } | - |
| 3541 | | - |
| 3542 | RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);executed 1 time by 1 test: retsize += (64); executed 1 time by 1 test: end of block | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 158318 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1-158318 |
| 3543 | if MBTEST(ch == CTLESC)| TRUE | evaluated 10 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 10 times by 1 test | | FALSE | evaluated 158309 times by 1 test |
| TRUE | evaluated 10 times by 1 test | | FALSE | never evaluated |
| 0-158309 |
| 3544 | ret[retind++] = CTLESC;executed 10 times by 1 test: ret[retind++] = '\001'; | 10 |
| 3545 | ret[retind++] = ch; | - |
| 3546 | continue;executed 158319 times by 1 test: continue; | 158319 |
| 3547 | } | - |
| 3548 | | - |
| 3549 | | - |
| 3550 | | - |
| 3551 | | - |
| 3552 | else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL))| TRUE | evaluated 26 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 21545 times by 1 test | | FALSE | evaluated 3764823 times by 1 test |
| TRUE | evaluated 5833 times by 1 test | | FALSE | evaluated 15712 times by 1 test |
| TRUE | evaluated 19 times by 1 test | | FALSE | evaluated 5814 times by 1 test |
| TRUE | evaluated 7 times by 1 test | | FALSE | evaluated 5807 times by 1 test |
| TRUE | evaluated 26 times by 1 test | | FALSE | never evaluated |
| 0-3764823 |
| 3553 | { | - |
| 3554 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 26 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-26 |
| 3555 | ret[retind++] = ch; | - |
| 3556 | continue;executed 26 times by 1 test: continue; | 26 |
| 3557 | } | - |
| 3558 | else if MBTEST(ch == CTLESC || ch == CTLNUL) | TRUE | evaluated 429 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 226 times by 1 test | | FALSE | evaluated 3786116 times by 1 test |
| TRUE | evaluated 203 times by 1 test | | FALSE | evaluated 3785913 times by 1 test |
| TRUE | evaluated 429 times by 1 test | | FALSE | never evaluated |
| 0-3786116 |
| 3559 | { | - |
| 3560 | RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 429 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-429 |
| 3561 | ret[retind++] = CTLESC; | - |
| 3562 | ret[retind++] = ch; | - |
| 3563 | continue;executed 429 times by 1 test: continue; | 429 |
| 3564 | } | - |
| 3565 | else if MBTEST(ch == close) | TRUE | evaluated 461638 times by 1 test | | FALSE | evaluated 88 times by 1 test |
| TRUE | evaluated 461726 times by 1 test | | FALSE | evaluated 3324187 times by 1 test |
| TRUE | evaluated 461726 times by 1 test | | FALSE | never evaluated |
| 0-3324187 |
| 3566 | count--;executed 461726 times by 1 test: count--; | 461726 |
| 3567 | | - |
| 3568 | else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) | TRUE | evaluated 161 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 588016 times by 1 test | | FALSE | evaluated 2736171 times by 1 test |
| TRUE | evaluated 5430 times by 1 test | | FALSE | evaluated 582586 times by 1 test |
| TRUE | evaluated 4644 times by 1 test | | FALSE | evaluated 786 times by 1 test |
| TRUE | evaluated 161 times by 1 test | | FALSE | evaluated 4483 times by 1 test |
| TRUE | evaluated 161 times by 1 test | | FALSE | never evaluated |
| 0-2736171 |
| 3569 | count++;executed 161 times by 1 test: count++; | 161 |
| 3570 | else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) | TRUE | evaluated 2984 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 3145709 times by 1 test | | FALSE | evaluated 178317 times by 1 test |
| TRUE | evaluated 2984 times by 1 test | | FALSE | evaluated 3142725 times by 1 test |
| TRUE | evaluated 2984 times by 1 test | | FALSE | never evaluated |
| 0-3145709 |
| 3571 | count++;executed 2984 times by 1 test: count++; | 2984 |
| 3572 | | - |
| 3573 | | - |
| 3574 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);executed 14045 times by 1 test: retsize += (64); executed 14045 times by 1 test: end of block | TRUE | evaluated 14045 times by 1 test | | FALSE | evaluated 3771868 times by 1 test |
| TRUE | evaluated 14045 times by 1 test | | FALSE | evaluated 14045 times by 1 test |
| 14045-3771868 |
| 3575 | ret[retind++] = ch; | - |
| 3576 | | - |
| 3577 | | - |
| 3578 | if (count == 0)| TRUE | evaluated 458742 times by 1 test | | FALSE | evaluated 3327171 times by 1 test |
| 458742-3327171 |
| 3579 | break;executed 458742 times by 1 test: break; | 458742 |
| 3580 | | - |
| 3581 | if (open == '\'') | TRUE | evaluated 524384 times by 1 test | | FALSE | evaluated 2802787 times by 1 test |
| 524384-2802787 |
| 3582 | { | - |
| 3583 | if MBTEST((flags & P_ALLOWESC) && ch == '\\')| TRUE | evaluated 4825 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 15233 times by 1 test | | FALSE | evaluated 509151 times by 1 test |
| TRUE | evaluated 4825 times by 1 test | | FALSE | evaluated 10408 times by 1 test |
| TRUE | evaluated 4825 times by 1 test | | FALSE | never evaluated |
| 0-509151 |
| 3584 | tflags |= LEX_PASSNEXT;executed 4825 times by 1 test: tflags |= 0x0008; | 4825 |
| 3585 | continue;executed 524384 times by 1 test: continue; | 524384 |
| 3586 | } | - |
| 3587 | | - |
| 3588 | if MBTEST(ch == '\\') | TRUE | evaluated 153494 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 153494 times by 1 test | | FALSE | evaluated 2649293 times by 1 test |
| TRUE | evaluated 153494 times by 1 test | | FALSE | never evaluated |
| 0-2649293 |
| 3589 | tflags |= LEX_PASSNEXT;executed 153494 times by 1 test: tflags |= 0x0008; | 153494 |
| 3590 | | - |
| 3591 | | - |
| 3592 | | - |
| 3593 | | - |
| 3594 | | - |
| 3595 | | - |
| 3596 | | - |
| 3597 | | - |
| 3598 | if (flags & P_DOLBRACE)| TRUE | evaluated 178478 times by 1 test | | FALSE | evaluated 2624309 times by 1 test |
| 178478-2624309 |
| 3599 | { | - |
| 3600 | | - |
| 3601 | if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1)| TRUE | evaluated 2530 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 105283 times by 1 test | | FALSE | evaluated 73195 times by 1 test |
| TRUE | evaluated 2530 times by 1 test | | FALSE | evaluated 102753 times by 1 test |
| TRUE | evaluated 2530 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2530 times by 1 test | | FALSE | never evaluated |
| 0-105283 |
| 3602 | dolbrace_state = DOLBRACE_QUOTE;executed 2530 times by 1 test: dolbrace_state = 0x40; | 2530 |
| 3603 | | - |
| 3604 | else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1)| TRUE | evaluated 2639 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 102753 times by 1 test | | FALSE | evaluated 73195 times by 1 test |
| TRUE | evaluated 3150 times by 1 test | | FALSE | evaluated 99603 times by 1 test |
| TRUE | evaluated 2639 times by 1 test | | FALSE | evaluated 511 times by 1 test |
| TRUE | evaluated 2639 times by 1 test | | FALSE | never evaluated |
| 0-102753 |
| 3605 | dolbrace_state = DOLBRACE_QUOTE;executed 2639 times by 1 test: dolbrace_state = 0x40; | 2639 |
| 3606 | | - |
| 3607 | else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1)| TRUE | evaluated 940 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 100114 times by 1 test | | FALSE | evaluated 73195 times by 1 test |
| TRUE | evaluated 940 times by 1 test | | FALSE | evaluated 99174 times by 1 test |
| TRUE | evaluated 940 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 940 times by 1 test | | FALSE | never evaluated |
| 0-100114 |
| 3608 | dolbrace_state = DOLBRACE_QUOTE2; executed 940 times by 1 test: dolbrace_state = 0x80; | 940 |
| 3609 | | - |
| 3610 | else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1)| TRUE | evaluated 42 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 99174 times by 1 test | | FALSE | evaluated 73195 times by 1 test |
| TRUE | evaluated 42 times by 1 test | | FALSE | evaluated 99132 times by 1 test |
| TRUE | evaluated 42 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 42 times by 1 test | | FALSE | never evaluated |
| 0-99174 |
| 3611 | dolbrace_state = DOLBRACE_QUOTE;executed 42 times by 1 test: dolbrace_state = 0x40; | 42 |
| 3612 | | - |
| 3613 | else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1)| TRUE | evaluated 44 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 99132 times by 1 test | | FALSE | evaluated 73195 times by 1 test |
| TRUE | evaluated 44 times by 1 test | | FALSE | evaluated 99088 times by 1 test |
| TRUE | evaluated 44 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 44 times by 1 test | | FALSE | never evaluated |
| 0-99132 |
| 3614 | dolbrace_state = DOLBRACE_QUOTE;executed 44 times by 1 test: dolbrace_state = 0x40; | 44 |
| 3615 | else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0)| TRUE | evaluated 11823 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 99088 times by 1 test | | FALSE | evaluated 73195 times by 1 test |
| TRUE | evaluated 11823 times by 1 test | | FALSE | evaluated 87265 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 99088 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 11823 times by 1 test | | FALSE | never evaluated |
| 0-99088 |
| 3616 | dolbrace_state = DOLBRACE_OP;executed 11823 times by 1 test: dolbrace_state = 0x02; | 11823 |
| 3617 | else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0)| TRUE | evaluated 11278 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 17072 times by 1 test | | FALSE | evaluated 143388 times by 1 test |
| TRUE | evaluated 11278 times by 1 test | | FALSE | evaluated 5794 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 17072 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 11278 times by 1 test | | FALSE | never evaluated |
| 0-143388 |
| 3618 | dolbrace_state = DOLBRACE_WORD;executed 11278 times by 1 test: dolbrace_state = 0x04; | 11278 |
| 3619 | }executed 178478 times by 1 test: end of block | 178478 |
| 3620 | | - |
| 3621 | | - |
| 3622 | | - |
| 3623 | | - |
| 3624 | | - |
| 3625 | | - |
| 3626 | if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')| TRUE | evaluated 221 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 16672 times by 1 test | | FALSE | evaluated 2786115 times by 1 test |
| TRUE | evaluated 16672 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 16624 times by 1 test | | FALSE | evaluated 48 times by 1 test |
| TRUE | evaluated 16624 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 6821 times by 1 test | | FALSE | evaluated 9803 times by 1 test |
| TRUE | evaluated 5161 times by 1 test | | FALSE | evaluated 1660 times by 1 test |
| TRUE | evaluated 221 times by 1 test | | FALSE | evaluated 4940 times by 1 test |
| TRUE | evaluated 221 times by 1 test | | FALSE | never evaluated |
| 0-2786115 |
| 3627 | continue;executed 221 times by 1 test: continue; | 221 |
| 3628 | | - |
| 3629 | | - |
| 3630 | | - |
| 3631 | if (open != close) | TRUE | evaluated 590779 times by 1 test | | FALSE | evaluated 2211787 times by 1 test |
| 590779-2211787 |
| 3632 | { | - |
| 3633 | if MBTEST(shellquote (ch))| TRUE | evaluated 10162 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 10162 times by 1 test | | FALSE | evaluated 580617 times by 1 test |
| TRUE | evaluated 10162 times by 1 test | | FALSE | never evaluated |
| 0-580617 |
| 3634 | { | - |
| 3635 | | - |
| 3636 | push_delimiter (dstack, ch);executed 263 times by 1 test: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 3636); | TRUE | evaluated 263 times by 1 test | | FALSE | evaluated 9899 times by 1 test |
| 263-9899 |
| 3637 | if MBTEST((tflags & LEX_WASDOL) && ch == '\'') | TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 80 times by 1 test | | FALSE | evaluated 10082 times by 1 test |
| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| 0-10082 |
| 3638 | nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags);executed 80 times by 1 test: nestret = parse_matched_pair (ch, ch, ch, &nestlen, 0x0002|rflags); | 80 |
| 3639 | else | - |
| 3640 | nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags);executed 10082 times by 1 test: nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); | 10082 |
| 3641 | pop_delimiter (dstack); | - |
| 3642 | CHECK_NESTRET_ERROR (); never executed: return &matched_pair_error; | TRUE | never evaluated | | FALSE | evaluated 10162 times by 1 test |
| 0-10162 |
| 3643 | | - |
| 3644 | if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0))| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 80 times by 1 test | | FALSE | evaluated 10082 times by 1 test |
| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| 0-10082 |
| 3645 | { | - |
| 3646 | | - |
| 3647 | ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); | - |
| 3648 | free (nestret); | - |
| 3649 | | - |
| 3650 | | - |
| 3651 | | - |
| 3652 | | - |
| 3653 | | - |
| 3654 | | - |
| 3655 | if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE))| TRUE | evaluated 80 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 42 times by 1 test | | FALSE | evaluated 38 times by 1 test |
| TRUE | evaluated 17 times by 1 test | | FALSE | evaluated 25 times by 1 test |
| TRUE | evaluated 17 times by 1 test | | FALSE | never evaluated |
| 0-80 |
| 3656 | { | - |
| 3657 | nestret = sh_single_quote (ttrans); | - |
| 3658 | free (ttrans); | - |
| 3659 | nestlen = strlen (nestret); | - |
| 3660 | }executed 17 times by 1 test: end of block | 17 |
| 3661 | else if ((rflags & P_DQUOTE) == 0)| TRUE | evaluated 38 times by 1 test | | FALSE | evaluated 25 times by 1 test |
| 25-38 |
| 3662 | { | - |
| 3663 | nestret = sh_single_quote (ttrans); | - |
| 3664 | free (ttrans); | - |
| 3665 | nestlen = strlen (nestret); | - |
| 3666 | }executed 38 times by 1 test: end of block | 38 |
| 3667 | else | - |
| 3668 | { | - |
| 3669 | nestret = ttrans; | - |
| 3670 | nestlen = ttranslen; | - |
| 3671 | }executed 25 times by 1 test: end of block | 25 |
| 3672 | retind -= 2; | - |
| 3673 | }executed 80 times by 1 test: end of block | 80 |
| 3674 | else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 10082 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-10082 |
| 3675 | { | - |
| 3676 | | - |
| 3677 | ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); | - |
| 3678 | free (nestret); | - |
| 3679 | | - |
| 3680 | nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); | - |
| 3681 | free (ttrans); | - |
| 3682 | nestlen = ttranslen + 2; | - |
| 3683 | retind -= 2; | - |
| 3684 | } never executed: end of block | 0 |
| 3685 | | - |
| 3686 | APPEND_NESTRET (); never executed: retsize += (64); never executed: end of block executed 10162 times by 1 test: end of block | TRUE | evaluated 10162 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 10162 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-10162 |
| 3687 | FREE (nestret);executed 10162 times by 1 test: sh_xfree((nestret), "./parse.y", 3687); | TRUE | evaluated 10162 times by 1 test | | FALSE | never evaluated |
| 0-10162 |
| 3688 | }executed 10162 times by 1 test: end of block | 10162 |
| 3689 | else if ((flags & (P_ARRAYSUB|P_DOLBRACE)) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) | TRUE | evaluated 193624 times by 1 test | | FALSE | evaluated 386993 times by 1 test |
| TRUE | evaluated 4616 times by 1 test | | FALSE | evaluated 189008 times by 1 test |
| TRUE | evaluated 215 times by 1 test | | FALSE | evaluated 4401 times by 1 test |
| TRUE | evaluated 163 times by 1 test | | FALSE | evaluated 4238 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 4238 times by 1 test |
| 0-386993 |
| 3690 | goto parse_dollar_word;executed 378 times by 1 test: goto parse_dollar_word; | 378 |
| 3691 | #if defined (PROCESS_SUBSTITUTION) | - |
| 3692 | | - |
| 3693 | | - |
| 3694 | else if ((flags & (P_ARRAYSUB|P_DOLBRACE)) && (tflags & LEX_GTLT) && (ch == '(')) | TRUE | evaluated 193246 times by 1 test | | FALSE | evaluated 386993 times by 1 test |
| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 193238 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 6 times by 1 test |
| 2-386993 |
| 3695 | goto parse_dollar_word;executed 2 times by 1 test: goto parse_dollar_word; | 2 |
| 3696 | #endif | - |
| 3697 | }executed 590399 times by 1 test: end of block | 590399 |
| 3698 | | - |
| 3699 | | - |
| 3700 | | - |
| 3701 | else if MBTEST(open == '"' && ch == '`')| TRUE | evaluated 171 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1670790 times by 1 test | | FALSE | evaluated 540997 times by 1 test |
| TRUE | evaluated 171 times by 1 test | | FALSE | evaluated 1670619 times by 1 test |
| TRUE | evaluated 171 times by 1 test | | FALSE | never evaluated |
| 0-1670790 |
| 3702 | { | - |
| 3703 | nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); | - |
| 3704 | | - |
| 3705 | CHECK_NESTRET_ERROR (); never executed: return &matched_pair_error; | TRUE | never evaluated | | FALSE | evaluated 171 times by 1 test |
| 0-171 |
| 3706 | APPEND_NESTRET (); never executed: retsize += (64); never executed: end of block executed 171 times by 1 test: end of block | TRUE | evaluated 171 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 171 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-171 |
| 3707 | | - |
| 3708 | FREE (nestret);executed 171 times by 1 test: sh_xfree((nestret), "./parse.y", 3708); | TRUE | evaluated 171 times by 1 test | | FALSE | never evaluated |
| 0-171 |
| 3709 | }executed 171 times by 1 test: end of block | 171 |
| 3710 | else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) | TRUE | evaluated 9628 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1670619 times by 1 test | | FALSE | evaluated 540997 times by 1 test |
| TRUE | evaluated 230953 times by 1 test | | FALSE | evaluated 1439666 times by 1 test |
| TRUE | evaluated 911 times by 1 test | | FALSE | evaluated 230042 times by 1 test |
| TRUE | evaluated 8717 times by 1 test | | FALSE | evaluated 221325 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 221325 times by 1 test |
| TRUE | evaluated 9628 times by 1 test | | FALSE | never evaluated |
| 0-1670619 |
| 3711 | | - |
| 3712 | { | - |
| 3713 | parse_dollar_word: | - |
| 3714 | if (open == ch) | TRUE | evaluated 161 times by 1 test | | FALSE | evaluated 9847 times by 1 test |
| 161-9847 |
| 3715 | count--;executed 161 times by 1 test: count--; | 161 |
| 3716 | if (ch == '(') | TRUE | evaluated 1128 times by 1 test | | FALSE | evaluated 8880 times by 1 test |
| 1128-8880 |
| 3717 | nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE);executed 1128 times by 1 test: nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|0x0008) & ~0x0004); | 1128 |
| 3718 | else if (ch == '{') | TRUE | evaluated 8880 times by 1 test | | FALSE | never evaluated |
| 0-8880 |
| 3719 | nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags);executed 8880 times by 1 test: nestret = parse_matched_pair (0, '{', '}', &nestlen, 0x0001|0x0040|rflags); | 8880 |
| 3720 | else if (ch == '[') | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3721 | nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); never executed: nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); | 0 |
| 3722 | | - |
| 3723 | CHECK_NESTRET_ERROR ();executed 3 times by 1 test: return &matched_pair_error; | TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 10005 times by 1 test |
| 3-10005 |
| 3724 | APPEND_NESTRET ();executed 47 times by 1 test: retsize += (64); executed 40 times by 1 test: end of block executed 10005 times by 1 test: end of block | TRUE | evaluated 10005 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 40 times by 1 test | | FALSE | evaluated 9965 times by 1 test |
| TRUE | evaluated 47 times by 1 test | | FALSE | evaluated 40 times by 1 test |
| 0-10005 |
| 3725 | | - |
| 3726 | FREE (nestret);executed 10005 times by 1 test: sh_xfree((nestret), "./parse.y", 3726); | TRUE | evaluated 10005 times by 1 test | | FALSE | never evaluated |
| 0-10005 |
| 3727 | }executed 10005 times by 1 test: end of block | 10005 |
| 3728 | #if defined (PROCESS_SUBSTITUTION) | - |
| 3729 | if MBTEST((ch == '<' || ch == '>') && (tflags & LEX_GTLT) == 0)| TRUE | evaluated 4565 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2619 times by 1 test | | FALSE | evaluated 2799944 times by 1 test |
| TRUE | evaluated 2000 times by 1 test | | FALSE | evaluated 2797944 times by 1 test |
| TRUE | evaluated 4565 times by 1 test | | FALSE | evaluated 54 times by 1 test |
| TRUE | evaluated 4565 times by 1 test | | FALSE | never evaluated |
| 0-2799944 |
| 3730 | tflags |= LEX_GTLT;executed 4565 times by 1 test: tflags |= 0x1000; | 4565 |
| 3731 | else | - |
| 3732 | tflags &= ~LEX_GTLT;executed 2797998 times by 1 test: tflags &= ~0x1000; | 2797998 |
| 3733 | #endif | - |
| 3734 | if MBTEST(ch == '$' && (tflags & LEX_WASDOL) == 0)| TRUE | evaluated 268535 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 268542 times by 1 test | | FALSE | evaluated 2534021 times by 1 test |
| TRUE | evaluated 268535 times by 1 test | | FALSE | evaluated 7 times by 1 test |
| TRUE | evaluated 268535 times by 1 test | | FALSE | never evaluated |
| 0-2534021 |
| 3735 | tflags |= LEX_WASDOL;executed 268535 times by 1 test: tflags |= 0x0001; | 268535 |
| 3736 | else | - |
| 3737 | tflags &= ~LEX_WASDOL;executed 2534028 times by 1 test: tflags &= ~0x0001; | 2534028 |
| 3738 | } | - |
| 3739 | | - |
| 3740 | ret[retind] = '\0'; | - |
| 3741 | if (lenp)| TRUE | evaluated 458742 times by 1 test | | FALSE | never evaluated |
| 0-458742 |
| 3742 | *lenp = retind;executed 458742 times by 1 test: *lenp = retind; | 458742 |
| 3743 | | - |
| 3744 | return ret;executed 458742 times by 1 test: return ret; | 458742 |
| 3745 | } | - |
| 3746 | | - |
| 3747 | #if defined (DEBUG) | - |
| 3748 | static void | - |
| 3749 | dump_tflags (flags) | - |
| 3750 | int flags; | - |
| 3751 | { | - |
| 3752 | int f; | - |
| 3753 | | - |
| 3754 | f = flags; | - |
| 3755 | fprintf (stderr, "%d -> ", f); | - |
| 3756 | if (f & LEX_WASDOL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3757 | { | - |
| 3758 | f &= ~LEX_WASDOL; | - |
| 3759 | fprintf (stderr, "LEX_WASDOL%s", f ? "|" : ""); | - |
| 3760 | } never executed: end of block | 0 |
| 3761 | if (f & LEX_CKCOMMENT)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3762 | { | - |
| 3763 | f &= ~LEX_CKCOMMENT; | - |
| 3764 | fprintf (stderr, "LEX_CKCOMMENT%s", f ? "|" : ""); | - |
| 3765 | } never executed: end of block | 0 |
| 3766 | if (f & LEX_INCOMMENT)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3767 | { | - |
| 3768 | f &= ~LEX_INCOMMENT; | - |
| 3769 | fprintf (stderr, "LEX_INCOMMENT%s", f ? "|" : ""); | - |
| 3770 | } never executed: end of block | 0 |
| 3771 | if (f & LEX_PASSNEXT)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3772 | { | - |
| 3773 | f &= ~LEX_PASSNEXT; | - |
| 3774 | fprintf (stderr, "LEX_PASSNEXT%s", f ? "|" : ""); | - |
| 3775 | } never executed: end of block | 0 |
| 3776 | if (f & LEX_RESWDOK)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3777 | { | - |
| 3778 | f &= ~LEX_RESWDOK; | - |
| 3779 | fprintf (stderr, "LEX_RESWDOK%s", f ? "|" : ""); | - |
| 3780 | } never executed: end of block | 0 |
| 3781 | if (f & LEX_CKCASE)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3782 | { | - |
| 3783 | f &= ~LEX_CKCASE; | - |
| 3784 | fprintf (stderr, "LEX_CKCASE%s", f ? "|" : ""); | - |
| 3785 | } never executed: end of block | 0 |
| 3786 | if (f & LEX_INCASE)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3787 | { | - |
| 3788 | f &= ~LEX_INCASE; | - |
| 3789 | fprintf (stderr, "LEX_INCASE%s", f ? "|" : ""); | - |
| 3790 | } never executed: end of block | 0 |
| 3791 | if (f & LEX_INHEREDOC)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3792 | { | - |
| 3793 | f &= ~LEX_INHEREDOC; | - |
| 3794 | fprintf (stderr, "LEX_INHEREDOC%s", f ? "|" : ""); | - |
| 3795 | } never executed: end of block | 0 |
| 3796 | if (f & LEX_HEREDELIM)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3797 | { | - |
| 3798 | f &= ~LEX_HEREDELIM; | - |
| 3799 | fprintf (stderr, "LEX_HEREDELIM%s", f ? "|" : ""); | - |
| 3800 | } never executed: end of block | 0 |
| 3801 | if (f & LEX_STRIPDOC)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3802 | { | - |
| 3803 | f &= ~LEX_STRIPDOC; | - |
| 3804 | fprintf (stderr, "LEX_WASDOL%s", f ? "|" : ""); | - |
| 3805 | } never executed: end of block | 0 |
| 3806 | if (f & LEX_QUOTEDDOC)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3807 | { | - |
| 3808 | f &= ~LEX_QUOTEDDOC; | - |
| 3809 | fprintf (stderr, "LEX_QUOTEDDOC%s", f ? "|" : ""); | - |
| 3810 | } never executed: end of block | 0 |
| 3811 | if (f & LEX_INWORD)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3812 | { | - |
| 3813 | f &= ~LEX_INWORD; | - |
| 3814 | fprintf (stderr, "LEX_INWORD%s", f ? "|" : ""); | - |
| 3815 | } never executed: end of block | 0 |
| 3816 | | - |
| 3817 | fprintf (stderr, "\n"); | - |
| 3818 | fflush (stderr); | - |
| 3819 | } never executed: end of block | 0 |
| 3820 | #endif | - |
| 3821 | | - |
| 3822 | | - |
| 3823 | | - |
| 3824 | static char * | - |
| 3825 | parse_comsub (qc, open, close, lenp, flags) | - |
| 3826 | int qc; | - |
| 3827 | int open, close; | - |
| 3828 | int *lenp, flags; | - |
| 3829 | { | - |
| 3830 | int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; | - |
| 3831 | int nestlen, ttranslen, start_lineno; | - |
| 3832 | char *ret, *nestret, *ttrans, *heredelim; | - |
| 3833 | int retind, retsize, rflags, hdlen; | - |
| 3834 | | - |
| 3835 | | - |
| 3836 | | - |
| 3837 | peekc = shell_getc (0); | - |
| 3838 | shell_ungetc (peekc); | - |
| 3839 | if (peekc == '(')| TRUE | evaluated 1330 times by 1 test | | FALSE | evaluated 23171 times by 1 test |
| 1330-23171 |
| 3840 | return (parse_matched_pair (qc, open, close, lenp, 0));executed 1330 times by 1 test: return (parse_matched_pair (qc, open, close, lenp, 0)); | 1330 |
| 3841 | | - |
| 3842 | | - |
| 3843 | count = 1; | - |
| 3844 | tflags = LEX_RESWDOK; | - |
| 3845 | | - |
| 3846 | if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0)| TRUE | evaluated 23171 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 23171 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 23171 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 23171 times by 1 test | | FALSE | never evaluated |
| 0-23171 |
| 3847 | tflags |= LEX_CKCASE;executed 23171 times by 1 test: tflags |= 0x0020; | 23171 |
| 3848 | if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments))| TRUE | evaluated 23171 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 23171 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-23171 |
| 3849 | tflags |= LEX_CKCOMMENT;executed 23171 times by 1 test: tflags |= 0x0002; | 23171 |
| 3850 | | - |
| 3851 | | - |
| 3852 | rflags = (flags & P_DQUOTE); | - |
| 3853 | | - |
| 3854 | ret = (char *)xmalloc (retsize = 64); | - |
| 3855 | retind = 0; | - |
| 3856 | | - |
| 3857 | start_lineno = line_number; | - |
| 3858 | lex_rwlen = lex_wlen = 0; | - |
| 3859 | | - |
| 3860 | heredelim = 0; | - |
| 3861 | lex_firstind = -1; | - |
| 3862 | | - |
| 3863 | while (count)| TRUE | evaluated 287113 times by 1 test | | FALSE | never evaluated |
| 0-287113 |
| 3864 | { | - |
| 3865 | comsub_readchar: | - |
| 3866 | ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT|LEX_QUOTEDDOC)) == 0); | - |
| 3867 | | - |
| 3868 | if (ch == EOF)| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 287109 times by 1 test |
| 4-287109 |
| 3869 | { | - |
| 3870 | eof_error: | - |
| 3871 | free (ret); | - |
| 3872 | FREE (heredelim);executed 2 times by 1 test: sh_xfree((heredelim), "./parse.y", 3872); | TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2 |
| 3873 | parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); | - |
| 3874 | EOF_Reached = 1; | - |
| 3875 | return (&matched_pair_error);executed 4 times by 1 test: return (&matched_pair_error); | 4 |
| 3876 | } | - |
| 3877 | | - |
| 3878 | | - |
| 3879 | | - |
| 3880 | | - |
| 3881 | | - |
| 3882 | | - |
| 3883 | if (ch == '\n')| TRUE | evaluated 2751 times by 1 test | | FALSE | evaluated 284358 times by 1 test |
| 2751-284358 |
| 3884 | { | - |
| 3885 | if ((tflags & LEX_HEREDELIM) && heredelim)| TRUE | evaluated 330 times by 1 test | | FALSE | evaluated 2421 times by 1 test |
| TRUE | evaluated 41 times by 1 test | | FALSE | evaluated 289 times by 1 test |
| 41-2421 |
| 3886 | { | - |
| 3887 | tflags &= ~LEX_HEREDELIM; | - |
| 3888 | tflags |= LEX_INHEREDOC; | - |
| 3889 | lex_firstind = retind + 1; | - |
| 3890 | }executed 41 times by 1 test: end of block | 41 |
| 3891 | else if (tflags & LEX_INHEREDOC)| TRUE | evaluated 684 times by 1 test | | FALSE | evaluated 2026 times by 1 test |
| 684-2026 |
| 3892 | { | - |
| 3893 | int tind; | - |
| 3894 | tind = lex_firstind; | - |
| 3895 | while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t')| TRUE | evaluated 96 times by 1 test | | FALSE | evaluated 620 times by 1 test |
| TRUE | evaluated 32 times by 1 test | | FALSE | evaluated 64 times by 1 test |
| 32-620 |
| 3896 | tind++;executed 32 times by 1 test: tind++; | 32 |
| 3897 | if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) never executed: __result = (((const unsigned char *) (const char *) ( ret + tind ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( heredelim ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 331 times by 1 test |
| TRUE | evaluated 331 times by 1 test | | FALSE | evaluated 353 times by 1 test |
| TRUE | evaluated 317 times by 1 test | | FALSE | evaluated 14 times by 1 test |
| TRUE | evaluated 317 times by 1 test | | FALSE | evaluated 14 times by 1 test |
| TRUE | evaluated 317 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 317 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-353 |
| 3898 | { | - |
| 3899 | tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC|LEX_QUOTEDDOC); | - |
| 3900 | | - |
| 3901 | free (heredelim); | - |
| 3902 | heredelim = 0; | - |
| 3903 | lex_firstind = -1; | - |
| 3904 | }executed 317 times by 1 test: end of block | 317 |
| 3905 | else | - |
| 3906 | lex_firstind = retind + 1;executed 367 times by 1 test: lex_firstind = retind + 1; | 367 |
| 3907 | } | - |
| 3908 | }executed 2751 times by 1 test: end of block | 2751 |
| 3909 | | - |
| 3910 | | - |
| 3911 | if (ch == '\n' && SHOULD_PROMPT ())| TRUE | evaluated 2751 times by 1 test | | FALSE | evaluated 284358 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 2751 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-284358 |
| 3912 | prompt_again (); never executed: prompt_again (); | 0 |
| 3913 | | - |
| 3914 | | - |
| 3915 | | - |
| 3916 | if ((tflags & LEX_INHEREDOC) && ch == close && count == 1)| TRUE | evaluated 4652 times by 1 test | | FALSE | evaluated 282457 times by 1 test |
| TRUE | evaluated 167 times by 1 test | | FALSE | evaluated 4485 times by 1 test |
| TRUE | evaluated 167 times by 1 test | | FALSE | never evaluated |
| 0-282457 |
| 3917 | { | - |
| 3918 | int tind; | - |
| 3919 | | - |
| 3920 | tind = lex_firstind; | - |
| 3921 | while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t')| TRUE | evaluated 32 times by 1 test | | FALSE | evaluated 135 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 32 times by 1 test |
| 0-135 |
| 3922 | tind++; never executed: tind++; | 0 |
| 3923 | if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) never executed: __result = (((const unsigned char *) (const char *) ( ret + tind ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( heredelim ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 11 times by 1 test |
| TRUE | evaluated 11 times by 1 test | | FALSE | evaluated 156 times by 1 test |
| TRUE | evaluated 11 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 11 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 11 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 11 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-156 |
| 3924 | { | - |
| 3925 | tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC|LEX_QUOTEDDOC); | - |
| 3926 | | - |
| 3927 | free (heredelim); | - |
| 3928 | heredelim = 0; | - |
| 3929 | lex_firstind = -1; | - |
| 3930 | }executed 11 times by 1 test: end of block | 11 |
| 3931 | }executed 167 times by 1 test: end of block | 167 |
| 3932 | | - |
| 3933 | | - |
| 3934 | | - |
| 3935 | | - |
| 3936 | | - |
| 3937 | | - |
| 3938 | | - |
| 3939 | | - |
| 3940 | | - |
| 3941 | | - |
| 3942 | if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC))| TRUE | evaluated 7562 times by 1 test | | FALSE | evaluated 279547 times by 1 test |
| 7562-279547 |
| 3943 | { | - |
| 3944 | | - |
| 3945 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);executed 4 times by 1 test: retsize += (64); executed 4 times by 1 test: end of block | TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 7558 times by 1 test |
| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 4-7558 |
| 3946 | ret[retind++] = ch; | - |
| 3947 | | - |
| 3948 | if ((tflags & LEX_INCOMMENT) && ch == '\n')| TRUE | evaluated 2921 times by 1 test | | FALSE | evaluated 4641 times by 1 test |
| TRUE | evaluated 233 times by 1 test | | FALSE | evaluated 2688 times by 1 test |
| 233-4641 |
| 3949 | { | - |
| 3950 | | - |
| 3951 | tflags &= ~LEX_INCOMMENT; | - |
| 3952 | }executed 233 times by 1 test: end of block | 233 |
| 3953 | | - |
| 3954 | continue;executed 7562 times by 1 test: continue; | 7562 |
| 3955 | } | - |
| 3956 | #if 0 | - |
| 3957 | | - |
| 3958 | | - |
| 3959 | | - |
| 3960 | if ((tflags & LEX_INHEREDOC) && ((tflags & LEX_WASDOL) == 0 || ch != '(')) | - |
| 3961 | { | - |
| 3962 | | - |
| 3963 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); | - |
| 3964 | ret[retind++] = ch; | - |
| 3965 | if MBTEST(ch == '$') | - |
| 3966 | tflags |= LEX_WASDOL; | - |
| 3967 | else | - |
| 3968 | tflags &= ~LEX_WASDOL; | - |
| 3969 | } | - |
| 3970 | #endif | - |
| 3971 | | - |
| 3972 | if (tflags & LEX_PASSNEXT) | TRUE | evaluated 258 times by 1 test | | FALSE | evaluated 279289 times by 1 test |
| 258-279289 |
| 3973 | { | - |
| 3974 | | - |
| 3975 | tflags &= ~LEX_PASSNEXT; | - |
| 3976 | if (qc != '\'' && ch == '\n') | TRUE | evaluated 258 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 258 times by 1 test |
| 0-258 |
| 3977 | { | - |
| 3978 | if (retind > 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 3979 | retind--; never executed: retind--; | 0 |
| 3980 | continue; never executed: continue; | 0 |
| 3981 | } | - |
| 3982 | | - |
| 3983 | RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);executed 2 times by 1 test: retsize += (64); executed 2 times by 1 test: end of block | TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 256 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-256 |
| 3984 | if MBTEST(ch == CTLESC)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 258 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-258 |
| 3985 | ret[retind++] = CTLESC; never executed: ret[retind++] = '\001'; | 0 |
| 3986 | ret[retind++] = ch; | - |
| 3987 | continue;executed 258 times by 1 test: continue; | 258 |
| 3988 | } | - |
| 3989 | | - |
| 3990 | | - |
| 3991 | | - |
| 3992 | if MBTEST(shellbreak (ch))| TRUE | evaluated 77297 times by 1 test | | FALSE | evaluated 1773 times by 1 test |
| TRUE | evaluated 79070 times by 1 test | | FALSE | evaluated 200219 times by 1 test |
| TRUE | evaluated 79070 times by 1 test | | FALSE | never evaluated |
| 0-200219 |
| 3993 | { | - |
| 3994 | tflags &= ~LEX_INWORD; | - |
| 3995 | | - |
| 3996 | }executed 79070 times by 1 test: end of block | 79070 |
| 3997 | else | - |
| 3998 | { | - |
| 3999 | if (tflags & LEX_INWORD)| TRUE | evaluated 147445 times by 1 test | | FALSE | evaluated 52774 times by 1 test |
| 52774-147445 |
| 4000 | { | - |
| 4001 | lex_wlen++; | - |
| 4002 | | - |
| 4003 | } executed 147445 times by 1 test: end of block | 147445 |
| 4004 | else | - |
| 4005 | { | - |
| 4006 | | - |
| 4007 | tflags |= LEX_INWORD; | - |
| 4008 | lex_wlen = 0; | - |
| 4009 | if (tflags & LEX_RESWDOK)| TRUE | evaluated 30313 times by 1 test | | FALSE | evaluated 22461 times by 1 test |
| 22461-30313 |
| 4010 | lex_rwlen = 0;executed 30313 times by 1 test: lex_rwlen = 0; | 30313 |
| 4011 | }executed 52774 times by 1 test: end of block | 52774 |
| 4012 | } | - |
| 4013 | | - |
| 4014 | | - |
| 4015 | if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0)| TRUE | evaluated 17138 times by 1 test | | FALSE | evaluated 990 times by 1 test |
| TRUE | evaluated 49025 times by 1 test | | FALSE | evaluated 230264 times by 1 test |
| TRUE | evaluated 48842 times by 1 test | | FALSE | evaluated 183 times by 1 test |
| TRUE | evaluated 18128 times by 1 test | | FALSE | evaluated 30714 times by 1 test |
| TRUE | evaluated 18128 times by 1 test | | FALSE | never evaluated |
| 0-230264 |
| 4016 | { | - |
| 4017 | | - |
| 4018 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);executed 94 times by 1 test: retsize += (64); executed 94 times by 1 test: end of block | TRUE | evaluated 94 times by 1 test | | FALSE | evaluated 18034 times by 1 test |
| TRUE | evaluated 94 times by 1 test | | FALSE | evaluated 94 times by 1 test |
| 94-18034 |
| 4019 | ret[retind++] = ch; | - |
| 4020 | continue;executed 18128 times by 1 test: continue; | 18128 |
| 4021 | } | - |
| 4022 | | - |
| 4023 | | - |
| 4024 | | - |
| 4025 | | - |
| 4026 | | - |
| 4027 | | - |
| 4028 | | - |
| 4029 | | - |
| 4030 | if (tflags & LEX_HEREDELIM)| TRUE | evaluated 1328 times by 1 test | | FALSE | evaluated 259833 times by 1 test |
| 1328-259833 |
| 4031 | { | - |
| 4032 | if (lex_firstind == -1 && shellbreak (ch) == 0)| TRUE | evaluated 490 times by 1 test | | FALSE | evaluated 838 times by 1 test |
| TRUE | evaluated 348 times by 1 test | | FALSE | evaluated 142 times by 1 test |
| 142-838 |
| 4033 | lex_firstind = retind;executed 348 times by 1 test: lex_firstind = retind; | 348 |
| 4034 | #if 0 | - |
| 4035 | else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') | - |
| 4036 | { | - |
| 4037 | tflags |= LEX_INHEREDOC; | - |
| 4038 | tflags &= ~LEX_HEREDELIM; | - |
| 4039 | lex_firstind = retind + 1; | - |
| 4040 | } | - |
| 4041 | #endif | - |
| 4042 | else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch))| TRUE | evaluated 838 times by 1 test | | FALSE | evaluated 142 times by 1 test |
| TRUE | evaluated 838 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 339 times by 1 test | | FALSE | evaluated 499 times by 1 test |
| 0-838 |
| 4043 | { | - |
| 4044 | if (heredelim == 0)| TRUE | evaluated 330 times by 1 test | | FALSE | evaluated 9 times by 1 test |
| 9-330 |
| 4045 | { | - |
| 4046 | nestret = substring (ret, lex_firstind, retind); | - |
| 4047 | heredelim = string_quote_removal (nestret, 0); | - |
| 4048 | hdlen = STRLEN(heredelim);| TRUE | evaluated 298 times by 1 test | | FALSE | evaluated 32 times by 1 test |
| TRUE | evaluated 298 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 330 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 330 times by 1 test | | FALSE | never evaluated |
| 0-330 |
| 4049 | | - |
| 4050 | if (STREQ (heredelim, nestret) == 0) never executed: __result = (((const unsigned char *) (const char *) ( heredelim ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( nestret ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | evaluated 182 times by 1 test | | FALSE | evaluated 148 times by 1 test |
| TRUE | evaluated 148 times by 1 test | | FALSE | evaluated 182 times by 1 test |
| TRUE | evaluated 148 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-182 |
| 4051 | tflags |= LEX_QUOTEDDOC;executed 182 times by 1 test: tflags |= 0x0400; | 182 |
| 4052 | free (nestret); | - |
| 4053 | }executed 330 times by 1 test: end of block | 330 |
| 4054 | if (ch == '\n')| TRUE | evaluated 289 times by 1 test | | FALSE | evaluated 50 times by 1 test |
| 50-289 |
| 4055 | { | - |
| 4056 | tflags |= LEX_INHEREDOC; | - |
| 4057 | tflags &= ~LEX_HEREDELIM; | - |
| 4058 | lex_firstind = retind + 1; | - |
| 4059 | }executed 289 times by 1 test: end of block | 289 |
| 4060 | else | - |
| 4061 | lex_firstind = -1;executed 50 times by 1 test: lex_firstind = -1; | 50 |
| 4062 | } | - |
| 4063 | }executed 1328 times by 1 test: end of block | 1328 |
| 4064 | | - |
| 4065 | | - |
| 4066 | if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n'))| TRUE | evaluated 24221 times by 1 test | | FALSE | evaluated 67 times by 1 test |
| TRUE | evaluated 122476 times by 1 test | | FALSE | evaluated 138685 times by 1 test |
| TRUE | evaluated 122476 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 122476 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 23559 times by 1 test | | FALSE | evaluated 98917 times by 1 test |
| TRUE | evaluated 729 times by 1 test | | FALSE | evaluated 98188 times by 1 test |
| TRUE | evaluated 24288 times by 1 test | | FALSE | never evaluated |
| 0-138685 |
| 4067 | { | - |
| 4068 | | - |
| 4069 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);executed 12 times by 1 test: retsize += (64); executed 12 times by 1 test: end of block | TRUE | evaluated 12 times by 1 test | | FALSE | evaluated 24276 times by 1 test |
| TRUE | evaluated 12 times by 1 test | | FALSE | evaluated 12 times by 1 test |
| 12-24276 |
| 4070 | ret[retind++] = ch; | - |
| 4071 | peekc = shell_getc (1); | - |
| 4072 | if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) | TRUE | evaluated 287 times by 1 test | | FALSE | evaluated 24001 times by 1 test |
| TRUE | evaluated 13 times by 1 test | | FALSE | evaluated 274 times by 1 test |
| TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 260 times by 1 test |
| TRUE | evaluated 241 times by 1 test | | FALSE | evaluated 19 times by 1 test |
| 13-24001 |
| 4073 | { | - |
| 4074 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 268 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-268 |
| 4075 | ret[retind++] = peekc; | - |
| 4076 | | - |
| 4077 | tflags |= LEX_RESWDOK; | - |
| 4078 | lex_rwlen = 0; | - |
| 4079 | continue;executed 268 times by 1 test: continue; | 268 |
| 4080 | } | - |
| 4081 | else if (ch == '\n' || COMSUB_META(ch))| TRUE | evaluated 729 times by 1 test | | FALSE | evaluated 23291 times by 1 test |
| TRUE | evaluated 2746 times by 1 test | | FALSE | evaluated 20545 times by 1 test |
| TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 20531 times by 1 test |
| TRUE | evaluated 287 times by 1 test | | FALSE | evaluated 20244 times by 1 test |
| 14-23291 |
| 4082 | { | - |
| 4083 | shell_ungetc (peekc); | - |
| 4084 | | - |
| 4085 | tflags |= LEX_RESWDOK; | - |
| 4086 | lex_rwlen = 0; | - |
| 4087 | continue;executed 3776 times by 1 test: continue; | 3776 |
| 4088 | } | - |
| 4089 | else if (ch == EOF)| TRUE | never evaluated | | FALSE | evaluated 20244 times by 1 test |
| 0-20244 |
| 4090 | goto eof_error; never executed: goto eof_error; | 0 |
| 4091 | else | - |
| 4092 | { | - |
| 4093 | | - |
| 4094 | retind--; | - |
| 4095 | shell_ungetc (peekc); | - |
| 4096 | }executed 20244 times by 1 test: end of block | 20244 |
| 4097 | } | - |
| 4098 | | - |
| 4099 | | - |
| 4100 | if (tflags & LEX_RESWDOK)| TRUE | evaluated 138685 times by 1 test | | FALSE | evaluated 118432 times by 1 test |
| 118432-138685 |
| 4101 | { | - |
| 4102 | if MBTEST(islower ((unsigned char)ch))| TRUE | evaluated 105083 times by 1 test | | FALSE | evaluated 351 times by 1 test |
| TRUE | evaluated 105434 times by 1 test | | FALSE | evaluated 33251 times by 1 test |
| TRUE | evaluated 105434 times by 1 test | | FALSE | never evaluated |
| 0-105434 |
| 4103 | { | - |
| 4104 | | - |
| 4105 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);executed 14 times by 1 test: retsize += (64); executed 14 times by 1 test: end of block | TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 105420 times by 1 test |
| TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 14 times by 1 test |
| 14-105420 |
| 4106 | ret[retind++] = ch; | - |
| 4107 | lex_rwlen++; | - |
| 4108 | continue;executed 105434 times by 1 test: continue; | 105434 |
| 4109 | } | - |
| 4110 | else if MBTEST(lex_rwlen == 4 && shellbreak (ch))| TRUE | evaluated 21253 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 21424 times by 1 test | | FALSE | evaluated 11827 times by 1 test |
| TRUE | evaluated 21253 times by 1 test | | FALSE | evaluated 171 times by 1 test |
| TRUE | evaluated 21253 times by 1 test | | FALSE | never evaluated |
| 0-21424 |
| 4111 | { | - |
| 4112 | if (STREQN (ret + retind - 4, "case", 4)) never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "case" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | evaluated 548 times by 1 test | | FALSE | evaluated 20705 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 21253 times by 1 test |
| TRUE | evaluated 548 times by 1 test | | FALSE | evaluated 20705 times by 1 test |
| TRUE | evaluated 548 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 548 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 548 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 548 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 548 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-21253 |
| 4113 | { | - |
| 4114 | tflags |= LEX_INCASE; | - |
| 4115 | tflags &= ~LEX_RESWDOK; | - |
| 4116 | | - |
| 4117 | }executed 548 times by 1 test: end of block | 548 |
| 4118 | else if (STREQN (ret + retind - 4, "esac", 4)) never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "esac" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | evaluated 548 times by 1 test | | FALSE | evaluated 20157 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 20705 times by 1 test |
| TRUE | evaluated 18272 times by 1 test | | FALSE | evaluated 2433 times by 1 test |
| TRUE | evaluated 548 times by 1 test | | FALSE | evaluated 17724 times by 1 test |
| TRUE | evaluated 18272 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 18272 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 18272 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 18272 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20705 |
| 4119 | { | - |
| 4120 | tflags &= ~LEX_INCASE; | - |
| 4121 | | - |
| 4122 | tflags |= LEX_RESWDOK; | - |
| 4123 | lex_rwlen = 0; | - |
| 4124 | }executed 548 times by 1 test: end of block | 548 |
| 4125 | else if (STREQN (ret + retind - 4, "done", 4) || never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "done" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 20157 times by 1 test |
| TRUE | evaluated 61 times by 1 test | | FALSE | evaluated 20096 times by 1 test |
| TRUE | evaluated 72 times by 1 test | | FALSE | evaluated 20085 times by 1 test |
| TRUE | evaluated 61 times by 1 test | | FALSE | evaluated 11 times by 1 test |
| TRUE | evaluated 72 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 72 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 72 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 72 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20157 |
| 4126 | STREQN (ret + retind - 4, "then", 4) || never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "then" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 20096 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 20095 times by 1 test |
| TRUE | evaluated 2315 times by 1 test | | FALSE | evaluated 17781 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 2314 times by 1 test |
| TRUE | evaluated 2315 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 2315 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 2315 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 2315 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20096 |
| 4127 | STREQN (ret + retind - 4, "else", 4) || never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "else" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 20095 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 20095 times by 1 test |
| TRUE | evaluated 17724 times by 1 test | | FALSE | evaluated 2371 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 17724 times by 1 test |
| TRUE | evaluated 17724 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 17724 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 17724 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 17724 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20095 |
| 4128 | STREQN (ret + retind - 4, "elif", 4) || never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "elif" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 20095 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 20095 times by 1 test |
| TRUE | evaluated 17724 times by 1 test | | FALSE | evaluated 2371 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 17724 times by 1 test |
| TRUE | evaluated 17724 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 17724 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 17724 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 17724 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20095 |
| 4129 | STREQN (ret + retind - 4, "time", 4)) never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 4 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "time" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 20095 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 20095 times by 1 test |
| TRUE | evaluated 2314 times by 1 test | | FALSE | evaluated 17781 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 2314 times by 1 test |
| TRUE | evaluated 2314 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 2314 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 2314 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 2314 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20095 |
| 4130 | { | - |
| 4131 | | - |
| 4132 | | - |
| 4133 | | - |
| 4134 | | - |
| 4135 | tflags |= LEX_RESWDOK; | - |
| 4136 | lex_rwlen = 0; | - |
| 4137 | }executed 62 times by 1 test: end of block | 62 |
| 4138 | else if (shellmeta (ch) == 0)| TRUE | evaluated 17797 times by 1 test | | FALSE | evaluated 2298 times by 1 test |
| 2298-17797 |
| 4139 | { | - |
| 4140 | tflags &= ~LEX_RESWDOK; | - |
| 4141 | | - |
| 4142 | }executed 17797 times by 1 test: end of block | 17797 |
| 4143 | else | - |
| 4144 | lex_rwlen = 0;executed 2298 times by 1 test: lex_rwlen = 0; | 2298 |
| 4145 | } | - |
| 4146 | else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))| TRUE | evaluated 152 times by 1 test | | FALSE | evaluated 14 times by 1 test |
| TRUE | evaluated 11998 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 166 times by 1 test | | FALSE | evaluated 11832 times by 1 test |
| TRUE | evaluated 166 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 166 times by 1 test | | FALSE | never evaluated |
| 0-11998 |
| 4147 | ; executed 166 times by 1 test: ; | 166 |
| 4148 | | - |
| 4149 | | - |
| 4150 | | - |
| 4151 | else if MBTEST(((tflags & LEX_INCASE) == 0) && never executed: __result = (((const unsigned char *) (const char *) ( ret + retind - 2 ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "do" ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 166 times by 1 test |
| TRUE | evaluated 61 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 11178 times by 1 test | | FALSE | evaluated 654 times by 1 test |
| TRUE | evaluated 3921 times by 1 test | | FALSE | evaluated 7257 times by 1 test |
| TRUE | evaluated 810 times by 1 test | | FALSE | evaluated 6447 times by 1 test |
| TRUE | evaluated 166 times by 1 test | | FALSE | evaluated 4565 times by 1 test |
| TRUE | evaluated 61 times by 1 test | | FALSE | evaluated 105 times by 1 test |
| TRUE | evaluated 61 times by 1 test | | FALSE | evaluated 105 times by 1 test |
| TRUE | evaluated 61 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 61 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 61 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 61 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 61 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 61 times by 1 test | | FALSE | never evaluated |
| 0-11178 |
| 4152 | (isblank((unsigned char)ch) || ch == '\n') && | - |
| 4153 | lex_rwlen == 2 && | - |
| 4154 | STREQN (ret + retind - 2, "do", 2)) | - |
| 4155 | { | - |
| 4156 | | - |
| 4157 | lex_rwlen = 0; | - |
| 4158 | }executed 61 times by 1 test: end of block | 61 |
| 4159 | else if MBTEST((tflags & LEX_INCASE) && ch != '\n')| TRUE | evaluated 276 times by 1 test | | FALSE | evaluated 8 times by 1 test |
| TRUE | evaluated 654 times by 1 test | | FALSE | evaluated 11117 times by 1 test |
| TRUE | evaluated 284 times by 1 test | | FALSE | evaluated 370 times by 1 test |
| TRUE | evaluated 284 times by 1 test | | FALSE | never evaluated |
| 0-11117 |
| 4160 | | - |
| 4161 | | - |
| 4162 | | - |
| 4163 | | - |
| 4164 | | - |
| 4165 | { | - |
| 4166 | tflags &= ~LEX_RESWDOK; | - |
| 4167 | | - |
| 4168 | }executed 284 times by 1 test: end of block | 284 |
| 4169 | else if MBTEST(shellbreak (ch) == 0)| TRUE | evaluated 4905 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4905 times by 1 test | | FALSE | evaluated 6582 times by 1 test |
| TRUE | evaluated 4905 times by 1 test | | FALSE | never evaluated |
| 0-6582 |
| 4170 | { | - |
| 4171 | tflags &= ~LEX_RESWDOK; | - |
| 4172 | | - |
| 4173 | }executed 4905 times by 1 test: end of block | 4905 |
| 4174 | #if 0 | - |
| 4175 | | - |
| 4176 | | - |
| 4177 | else if MBTEST(isblank ((unsigned char)ch) && lex_rwlen > 0) | - |
| 4178 | { | - |
| 4179 | tflags &= ~LEX_RESWDOK; | - |
| 4180 | | - |
| 4181 | } | - |
| 4182 | #endif | - |
| 4183 | }executed 33251 times by 1 test: end of block | 33251 |
| 4184 | | - |
| 4185 | | - |
| 4186 | if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<')| TRUE | evaluated 378 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 151683 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 151683 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 378 times by 1 test | | FALSE | evaluated 151305 times by 1 test |
| TRUE | evaluated 378 times by 1 test | | FALSE | never evaluated |
| 0-151683 |
| 4187 | { | - |
| 4188 | | - |
| 4189 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 378 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-378 |
| 4190 | ret[retind++] = ch; | - |
| 4191 | peekc = shell_getc (1); | - |
| 4192 | if (peekc == EOF)| TRUE | never evaluated | | FALSE | evaluated 378 times by 1 test |
| 0-378 |
| 4193 | goto eof_error; never executed: goto eof_error; | 0 |
| 4194 | if (peekc == ch)| TRUE | evaluated 332 times by 1 test | | FALSE | evaluated 46 times by 1 test |
| 46-332 |
| 4195 | { | - |
| 4196 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 332 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-332 |
| 4197 | ret[retind++] = peekc; | - |
| 4198 | peekc = shell_getc (1); | - |
| 4199 | if (peekc == EOF)| TRUE | never evaluated | | FALSE | evaluated 332 times by 1 test |
| 0-332 |
| 4200 | goto eof_error; never executed: goto eof_error; | 0 |
| 4201 | if (peekc == '-')| TRUE | evaluated 32 times by 1 test | | FALSE | evaluated 300 times by 1 test |
| 32-300 |
| 4202 | { | - |
| 4203 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 32 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-32 |
| 4204 | ret[retind++] = peekc; | - |
| 4205 | tflags |= LEX_STRIPDOC; | - |
| 4206 | }executed 32 times by 1 test: end of block | 32 |
| 4207 | else | - |
| 4208 | shell_ungetc (peekc);executed 300 times by 1 test: shell_ungetc (peekc); | 300 |
| 4209 | if (peekc != '<')| TRUE | evaluated 330 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-330 |
| 4210 | { | - |
| 4211 | tflags |= LEX_HEREDELIM; | - |
| 4212 | lex_firstind = -1; | - |
| 4213 | }executed 330 times by 1 test: end of block | 330 |
| 4214 | continue;executed 332 times by 1 test: continue; | 332 |
| 4215 | } | - |
| 4216 | else | - |
| 4217 | { | - |
| 4218 | shell_ungetc (peekc); | - |
| 4219 | continue;executed 46 times by 1 test: continue; | 46 |
| 4220 | } | - |
| 4221 | } | - |
| 4222 | else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0)))| TRUE | evaluated 219 times by 1 test | | FALSE | evaluated 14 times by 1 test |
| TRUE | evaluated 151305 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 151305 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 275 times by 1 test | | FALSE | evaluated 151030 times by 1 test |
| TRUE | evaluated 166 times by 1 test | | FALSE | evaluated 109 times by 1 test |
| TRUE | evaluated 166 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 109 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 67 times by 1 test | | FALSE | evaluated 42 times by 1 test |
| TRUE | evaluated 233 times by 1 test | | FALSE | never evaluated |
| 0-151305 |
| 4223 | { | - |
| 4224 | | - |
| 4225 | tflags |= LEX_INCOMMENT; | - |
| 4226 | }executed 233 times by 1 test: end of block | 233 |
| 4227 | | - |
| 4228 | if MBTEST(ch == CTLESC || ch == CTLNUL) | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 151305 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 151305 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-151305 |
| 4229 | { | - |
| 4230 | RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); never executed: retsize += (64); never executed: end of block | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4231 | ret[retind++] = CTLESC; | - |
| 4232 | ret[retind++] = ch; | - |
| 4233 | continue; never executed: continue; | 0 |
| 4234 | } | - |
| 4235 | #if 0 | - |
| 4236 | else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') | - |
| 4237 | tflags &= ~LEX_INCASE; | - |
| 4238 | #endif | - |
| 4239 | else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) | TRUE | evaluated 22505 times by 1 test | | FALSE | evaluated 671 times by 1 test |
| TRUE | evaluated 23746 times by 1 test | | FALSE | evaluated 127559 times by 1 test |
| TRUE | evaluated 23176 times by 1 test | | FALSE | evaluated 570 times by 1 test |
| TRUE | evaluated 23176 times by 1 test | | FALSE | never evaluated |
| 0-127559 |
| 4240 | { | - |
| 4241 | count--; | - |
| 4242 | | - |
| 4243 | }executed 23176 times by 1 test: end of block | 23176 |
| 4244 | else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) | TRUE | evaluated 14 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 128129 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 116449 times by 1 test | | FALSE | evaluated 11680 times by 1 test |
| TRUE | evaluated 14 times by 1 test | | FALSE | evaluated 116435 times by 1 test |
| TRUE | evaluated 14 times by 1 test | | FALSE | never evaluated |
| 0-128129 |
| 4245 | { | - |
| 4246 | count++; | - |
| 4247 | | - |
| 4248 | }executed 14 times by 1 test: end of block | 14 |
| 4249 | | - |
| 4250 | | - |
| 4251 | RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);executed 70 times by 1 test: retsize += (64); executed 70 times by 1 test: end of block | TRUE | evaluated 70 times by 1 test | | FALSE | evaluated 151235 times by 1 test |
| TRUE | evaluated 70 times by 1 test | | FALSE | evaluated 70 times by 1 test |
| 70-151235 |
| 4252 | ret[retind++] = ch; | - |
| 4253 | | - |
| 4254 | | - |
| 4255 | if (count == 0)| TRUE | evaluated 23167 times by 1 test | | FALSE | evaluated 128138 times by 1 test |
| 23167-128138 |
| 4256 | break;executed 23167 times by 1 test: break; | 23167 |
| 4257 | | - |
| 4258 | if MBTEST(ch == '\\') | TRUE | evaluated 258 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 258 times by 1 test | | FALSE | evaluated 127880 times by 1 test |
| TRUE | evaluated 258 times by 1 test | | FALSE | never evaluated |
| 0-127880 |
| 4259 | tflags |= LEX_PASSNEXT;executed 258 times by 1 test: tflags |= 0x0008; | 258 |
| 4260 | | - |
| 4261 | if MBTEST(shellquote (ch))| TRUE | evaluated 1681 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1681 times by 1 test | | FALSE | evaluated 126457 times by 1 test |
| TRUE | evaluated 1681 times by 1 test | | FALSE | never evaluated |
| 0-126457 |
| 4262 | { | - |
| 4263 | | - |
| 4264 | push_delimiter (dstack, ch);executed 1 time by 1 test: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 4264); | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1680 times by 1 test |
| 1-1680 |
| 4265 | if MBTEST((tflags & LEX_WASDOL) && ch == '\'') | TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 22 times by 1 test | | FALSE | evaluated 1659 times by 1 test |
| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| 0-1659 |
| 4266 | nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags);executed 22 times by 1 test: nestret = parse_matched_pair (ch, ch, ch, &nestlen, 0x0002|rflags); | 22 |
| 4267 | else | - |
| 4268 | nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags);executed 1659 times by 1 test: nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); | 1659 |
| 4269 | pop_delimiter (dstack); | - |
| 4270 | CHECK_NESTRET_ERROR (); never executed: return &matched_pair_error; | TRUE | never evaluated | | FALSE | evaluated 1681 times by 1 test |
| 0-1681 |
| 4271 | | - |
| 4272 | if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0))| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 22 times by 1 test | | FALSE | evaluated 1659 times by 1 test |
| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| 0-1659 |
| 4273 | { | - |
| 4274 | | - |
| 4275 | ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); | - |
| 4276 | free (nestret); | - |
| 4277 | | - |
| 4278 | if ((rflags & P_DQUOTE) == 0)| TRUE | evaluated 22 times by 1 test | | FALSE | never evaluated |
| 0-22 |
| 4279 | { | - |
| 4280 | nestret = sh_single_quote (ttrans); | - |
| 4281 | free (ttrans); | - |
| 4282 | nestlen = strlen (nestret); | - |
| 4283 | }executed 22 times by 1 test: end of block | 22 |
| 4284 | else | - |
| 4285 | { | - |
| 4286 | nestret = ttrans; | - |
| 4287 | nestlen = ttranslen; | - |
| 4288 | } never executed: end of block | 0 |
| 4289 | retind -= 2; | - |
| 4290 | }executed 22 times by 1 test: end of block | 22 |
| 4291 | else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 1659 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-1659 |
| 4292 | { | - |
| 4293 | | - |
| 4294 | ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); | - |
| 4295 | free (nestret); | - |
| 4296 | | - |
| 4297 | nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); | - |
| 4298 | free (ttrans); | - |
| 4299 | nestlen = ttranslen + 2; | - |
| 4300 | retind -= 2; | - |
| 4301 | } never executed: end of block | 0 |
| 4302 | | - |
| 4303 | APPEND_NESTRET ();executed 107 times by 1 test: retsize += (64); executed 88 times by 1 test: end of block executed 1681 times by 1 test: end of block | TRUE | evaluated 1681 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 88 times by 1 test | | FALSE | evaluated 1593 times by 1 test |
| TRUE | evaluated 107 times by 1 test | | FALSE | evaluated 88 times by 1 test |
| 0-1681 |
| 4304 | FREE (nestret);executed 1681 times by 1 test: sh_xfree((nestret), "./parse.y", 4304); | TRUE | evaluated 1681 times by 1 test | | FALSE | never evaluated |
| 0-1681 |
| 4305 | }executed 1681 times by 1 test: end of block | 1681 |
| 4306 | else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) | TRUE | evaluated 211 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 482 times by 1 test | | FALSE | evaluated 125975 times by 1 test |
| TRUE | evaluated 35 times by 1 test | | FALSE | evaluated 447 times by 1 test |
| TRUE | evaluated 176 times by 1 test | | FALSE | evaluated 271 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 271 times by 1 test |
| TRUE | evaluated 211 times by 1 test | | FALSE | never evaluated |
| 0-125975 |
| 4307 | | - |
| 4308 | { | - |
| 4309 | if ((tflags & LEX_INCASE) == 0 && open == ch) | TRUE | evaluated 181 times by 1 test | | FALSE | evaluated 30 times by 1 test |
| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 176 times by 1 test |
| 5-181 |
| 4310 | count--;executed 5 times by 1 test: count--; | 5 |
| 4311 | if (ch == '(') | TRUE | evaluated 35 times by 1 test | | FALSE | evaluated 176 times by 1 test |
| 35-176 |
| 4312 | nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE);executed 35 times by 1 test: nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|0x0008) & ~0x0004); | 35 |
| 4313 | else if (ch == '{') | TRUE | evaluated 176 times by 1 test | | FALSE | never evaluated |
| 0-176 |
| 4314 | nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags);executed 176 times by 1 test: nestret = parse_matched_pair (0, '{', '}', &nestlen, 0x0001|0x0040|rflags); | 176 |
| 4315 | else if (ch == '[') | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4316 | nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); never executed: nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); | 0 |
| 4317 | | - |
| 4318 | CHECK_NESTRET_ERROR (); never executed: return &matched_pair_error; | TRUE | never evaluated | | FALSE | evaluated 211 times by 1 test |
| 0-211 |
| 4319 | APPEND_NESTRET (); never executed: retsize += (64); never executed: end of block executed 211 times by 1 test: end of block | TRUE | evaluated 211 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 211 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-211 |
| 4320 | | - |
| 4321 | FREE (nestret);executed 211 times by 1 test: sh_xfree((nestret), "./parse.y", 4321); | TRUE | evaluated 211 times by 1 test | | FALSE | never evaluated |
| 0-211 |
| 4322 | }executed 211 times by 1 test: end of block | 211 |
| 4323 | if MBTEST(ch == '$' && (tflags & LEX_WASDOL) == 0)| TRUE | evaluated 504 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 506 times by 1 test | | FALSE | evaluated 127632 times by 1 test |
| TRUE | evaluated 504 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| TRUE | evaluated 504 times by 1 test | | FALSE | never evaluated |
| 0-127632 |
| 4324 | tflags |= LEX_WASDOL;executed 504 times by 1 test: tflags |= 0x0001; | 504 |
| 4325 | else | - |
| 4326 | tflags &= ~LEX_WASDOL;executed 127634 times by 1 test: tflags &= ~0x0001; | 127634 |
| 4327 | } | - |
| 4328 | | - |
| 4329 | FREE (heredelim); never executed: sh_xfree((heredelim), "./parse.y", 4329); | TRUE | never evaluated | | FALSE | evaluated 23167 times by 1 test |
| 0-23167 |
| 4330 | ret[retind] = '\0'; | - |
| 4331 | if (lenp)| TRUE | evaluated 23167 times by 1 test | | FALSE | never evaluated |
| 0-23167 |
| 4332 | *lenp = retind;executed 23167 times by 1 test: *lenp = retind; | 23167 |
| 4333 | | - |
| 4334 | return ret;executed 23167 times by 1 test: return ret; | 23167 |
| 4335 | } | - |
| 4336 | | - |
| 4337 | | - |
| 4338 | char * | - |
| 4339 | xparse_dolparen (base, string, indp, flags) | - |
| 4340 | char *base; | - |
| 4341 | char *string; | - |
| 4342 | int *indp; | - |
| 4343 | int flags; | - |
| 4344 | { | - |
| 4345 | sh_parser_state_t ps; | - |
| 4346 | sh_input_line_state_t ls; | - |
| 4347 | int orig_ind, nc, sflags, orig_eof_token; | - |
| 4348 | char *ret, *ep, *ostring; | - |
| 4349 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 4350 | STRING_SAVER *saved_pushed_strings; | - |
| 4351 | #endif | - |
| 4352 | | - |
| 4353 | | - |
| 4354 | orig_ind = *indp; | - |
| 4355 | ostring = string; | - |
| 4356 | | - |
| 4357 | if (*string == 0)| TRUE | never evaluated | | FALSE | evaluated 705307 times by 1 test |
| 0-705307 |
| 4358 | { | - |
| 4359 | if (flags & SX_NOALLOC) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4360 | return (char *)NULL; never executed: return (char *) ((void *)0) ; | 0 |
| 4361 | | - |
| 4362 | ret = xmalloc (1); | - |
| 4363 | ret[0] = '\0'; | - |
| 4364 | return ret; never executed: return ret; | 0 |
| 4365 | } | - |
| 4366 | | - |
| 4367 | | - |
| 4368 | sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; | - |
| 4369 | if (flags & SX_NOLONGJMP)| TRUE | evaluated 69 times by 1 test | | FALSE | evaluated 705238 times by 1 test |
| 69-705238 |
| 4370 | sflags |= SEVAL_NOLONGJMP;executed 69 times by 1 test: sflags |= 0x040; | 69 |
| 4371 | save_parser_state (&ps); | - |
| 4372 | save_input_line_state (&ls); | - |
| 4373 | orig_eof_token = shell_eof_token; | - |
| 4374 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 4375 | saved_pushed_strings = pushed_string_list; | - |
| 4376 | pushed_string_list = (STRING_SAVER *)NULL; | - |
| 4377 | #endif | - |
| 4378 | | - |
| 4379 | | - |
| 4380 | parser_state |= PST_CMDSUBST|PST_EOFTOKEN; | - |
| 4381 | shell_eof_token = ')'; | - |
| 4382 | | - |
| 4383 | | - |
| 4384 | | - |
| 4385 | | - |
| 4386 | nc = parse_string (string, "command substitution", sflags, &ep); | - |
| 4387 | | - |
| 4388 | if (current_token == shell_eof_token)| TRUE | evaluated 704328 times by 1 test | | FALSE | evaluated 979 times by 1 test |
| 979-704328 |
| 4389 | yyclearin; executed 704328 times by 1 test: (yychar = (-2)); | 704328 |
| 4390 | | - |
| 4391 | shell_eof_token = orig_eof_token; | - |
| 4392 | restore_parser_state (&ps); | - |
| 4393 | reset_parser (); | - |
| 4394 | | - |
| 4395 | restore_input_line_state (&ls); | - |
| 4396 | | - |
| 4397 | #if defined (ALIAS) || defined (DPAREN_ARITHMETIC) | - |
| 4398 | pushed_string_list = saved_pushed_strings; | - |
| 4399 | #endif | - |
| 4400 | | - |
| 4401 | token_to_read = 0; | - |
| 4402 | | - |
| 4403 | | - |
| 4404 | | - |
| 4405 | | - |
| 4406 | if (nc < 0)| TRUE | evaluated 7 times by 1 test | | FALSE | evaluated 705300 times by 1 test |
| 7-705300 |
| 4407 | { | - |
| 4408 | clear_shell_input_line (); | - |
| 4409 | jump_to_top_level (-nc); | - |
| 4410 | } never executed: end of block | 0 |
| 4411 | | - |
| 4412 | | - |
| 4413 | | - |
| 4414 | | - |
| 4415 | | - |
| 4416 | | - |
| 4417 | if (ep[-1] != ')')| TRUE | never evaluated | | FALSE | evaluated 705300 times by 1 test |
| 0-705300 |
| 4418 | { | - |
| 4419 | #if DEBUG | - |
| 4420 | if (ep[-1] != '\n')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4421 | itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); never executed: itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); | 0 |
| 4422 | #endif | - |
| 4423 | while (ep > ostring && ep[-1] == '\n') ep--; never executed: ep--; | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4424 | } never executed: end of block | 0 |
| 4425 | | - |
| 4426 | nc = ep - ostring; | - |
| 4427 | *indp = ep - base - 1; | - |
| 4428 | | - |
| 4429 | | - |
| 4430 | #if DEBUG | - |
| 4431 | if (base[*indp] != ')')| TRUE | never evaluated | | FALSE | evaluated 705300 times by 1 test |
| 0-705300 |
| 4432 | itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); never executed: itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); | 0 |
| 4433 | if (*indp < orig_ind)| TRUE | never evaluated | | FALSE | evaluated 705300 times by 1 test |
| 0-705300 |
| 4434 | itrace("xparse_dolparen:%d: *indp (%d) < orig_ind (%d), orig_string = `%s'", line_number, *indp, orig_ind, ostring); never executed: itrace("xparse_dolparen:%d: *indp (%d) < orig_ind (%d), orig_string = `%s'", line_number, *indp, orig_ind, ostring); | 0 |
| 4435 | #endif | - |
| 4436 | | - |
| 4437 | if (flags & SX_NOALLOC) | TRUE | evaluated 212 times by 1 test | | FALSE | evaluated 705088 times by 1 test |
| 212-705088 |
| 4438 | return (char *)NULL;executed 212 times by 1 test: return (char *) ((void *)0) ; | 212 |
| 4439 | | - |
| 4440 | if (nc == 0)| TRUE | never evaluated | | FALSE | evaluated 705088 times by 1 test |
| 0-705088 |
| 4441 | { | - |
| 4442 | ret = xmalloc (1); | - |
| 4443 | ret[0] = '\0'; | - |
| 4444 | } never executed: end of block | 0 |
| 4445 | else | - |
| 4446 | ret = substring (ostring, 0, nc - 1);executed 705088 times by 1 test: ret = substring (ostring, 0, nc - 1); | 705088 |
| 4447 | | - |
| 4448 | return ret;executed 705088 times by 1 test: return ret; | 705088 |
| 4449 | } | - |
| 4450 | | - |
| 4451 | #if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) | - |
| 4452 | | - |
| 4453 | | - |
| 4454 | | - |
| 4455 | | - |
| 4456 | static int | - |
| 4457 | parse_dparen (c) | - |
| 4458 | int c; | - |
| 4459 | { | - |
| 4460 | int cmdtyp, sline; | - |
| 4461 | char *wval; | - |
| 4462 | WORD_DESC *wd; | - |
| 4463 | | - |
| 4464 | #if defined (ARITH_FOR_COMMAND) | - |
| 4465 | if (last_read_token == FOR)| TRUE | evaluated 2641 times by 1 test | | FALSE | evaluated 47097 times by 1 test |
| 2641-47097 |
| 4466 | { | - |
| 4467 | arith_for_lineno = line_number; | - |
| 4468 | cmdtyp = parse_arith_cmd (&wval, 0); | - |
| 4469 | if (cmdtyp == 1)| TRUE | evaluated 2641 times by 1 test | | FALSE | never evaluated |
| 0-2641 |
| 4470 | { | - |
| 4471 | wd = alloc_word_desc (); | - |
| 4472 | wd->word = wval; | - |
| 4473 | yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); | - |
| 4474 | return (ARITH_FOR_EXPRS);executed 2641 times by 1 test: return (286); | 2641 |
| 4475 | } | - |
| 4476 | else | - |
| 4477 | return -1; never executed: return -1; | 0 |
| 4478 | } | - |
| 4479 | #endif | - |
| 4480 | | - |
| 4481 | #if defined (DPAREN_ARITHMETIC) | - |
| 4482 | if (reserved_word_acceptable (last_read_token))| TRUE | evaluated 47097 times by 1 test | | FALSE | never evaluated |
| 0-47097 |
| 4483 | { | - |
| 4484 | sline = line_number; | - |
| 4485 | | - |
| 4486 | cmdtyp = parse_arith_cmd (&wval, 0); | - |
| 4487 | if (cmdtyp == 1) | TRUE | evaluated 47077 times by 1 test | | FALSE | evaluated 20 times by 1 test |
| 20-47077 |
| 4488 | { | - |
| 4489 | wd = alloc_word_desc (); | - |
| 4490 | wd->word = wval; | - |
| 4491 | wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; | - |
| 4492 | yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); | - |
| 4493 | return (ARITH_CMD);executed 47077 times by 1 test: return (285); | 47077 |
| 4494 | } | - |
| 4495 | else if (cmdtyp == 0) | TRUE | evaluated 20 times by 1 test | | FALSE | never evaluated |
| 0-20 |
| 4496 | { | - |
| 4497 | push_string (wval, 0, (alias_t *)NULL); | - |
| 4498 | pushed_string_list->flags = PSH_DPAREN; | - |
| 4499 | if ((parser_state & PST_CASEPAT) == 0)| TRUE | evaluated 20 times by 1 test | | FALSE | never evaluated |
| 0-20 |
| 4500 | parser_state |= PST_SUBSHELL;executed 20 times by 1 test: parser_state |= 0x000020; | 20 |
| 4501 | return (c);executed 20 times by 1 test: return (c); | 20 |
| 4502 | } | - |
| 4503 | else | - |
| 4504 | return -1; never executed: return -1; | 0 |
| 4505 | } | - |
| 4506 | #endif | - |
| 4507 | | - |
| 4508 | return -2; never executed: return -2; | 0 |
| 4509 | } | - |
| 4510 | | - |
| 4511 | | - |
| 4512 | | - |
| 4513 | | - |
| 4514 | | - |
| 4515 | | - |
| 4516 | static int | - |
| 4517 | parse_arith_cmd (ep, adddq) | - |
| 4518 | char **ep; | - |
| 4519 | int adddq; | - |
| 4520 | { | - |
| 4521 | int exp_lineno, rval, c; | - |
| 4522 | char *ttok, *tokstr; | - |
| 4523 | int ttoklen; | - |
| 4524 | | - |
| 4525 | exp_lineno = line_number; | - |
| 4526 | ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); | - |
| 4527 | rval = 1; | - |
| 4528 | if (ttok == &matched_pair_error)| TRUE | never evaluated | | FALSE | evaluated 49738 times by 1 test |
| 0-49738 |
| 4529 | return -1; never executed: return -1; | 0 |
| 4530 | | - |
| 4531 | | - |
| 4532 | c = shell_getc (0); | - |
| 4533 | if MBTEST(c != ')')| TRUE | evaluated 20 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 20 times by 1 test | | FALSE | evaluated 49718 times by 1 test |
| TRUE | evaluated 20 times by 1 test | | FALSE | never evaluated |
| 0-49718 |
| 4534 | rval = 0;executed 20 times by 1 test: rval = 0; | 20 |
| 4535 | | - |
| 4536 | tokstr = (char *)xmalloc (ttoklen + 4); | - |
| 4537 | | - |
| 4538 | | - |
| 4539 | if (rval == 1 && adddq) | TRUE | evaluated 49718 times by 1 test | | FALSE | evaluated 20 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 49718 times by 1 test |
| 0-49718 |
| 4540 | { | - |
| 4541 | tokstr[0] = '"'; | - |
| 4542 | strncpy (tokstr + 1, ttok, ttoklen - 1); | - |
| 4543 | tokstr[ttoklen] = '"'; | - |
| 4544 | tokstr[ttoklen+1] = '\0'; | - |
| 4545 | } never executed: end of block | 0 |
| 4546 | else if (rval == 1) | TRUE | evaluated 49718 times by 1 test | | FALSE | evaluated 20 times by 1 test |
| 20-49718 |
| 4547 | { | - |
| 4548 | strncpy (tokstr, ttok, ttoklen - 1); | - |
| 4549 | tokstr[ttoklen-1] = '\0'; | - |
| 4550 | }executed 49718 times by 1 test: end of block | 49718 |
| 4551 | else | - |
| 4552 | { | - |
| 4553 | tokstr[0] = '('; | - |
| 4554 | strncpy (tokstr + 1, ttok, ttoklen - 1); | - |
| 4555 | tokstr[ttoklen] = ')'; | - |
| 4556 | tokstr[ttoklen+1] = c; | - |
| 4557 | tokstr[ttoklen+2] = '\0'; | - |
| 4558 | }executed 20 times by 1 test: end of block | 20 |
| 4559 | | - |
| 4560 | *ep = tokstr; | - |
| 4561 | FREE (ttok);executed 49738 times by 1 test: sh_xfree((ttok), "./parse.y", 4561); | TRUE | evaluated 49738 times by 1 test | | FALSE | never evaluated |
| 0-49738 |
| 4562 | return rval;executed 49738 times by 1 test: return rval; | 49738 |
| 4563 | } | - |
| 4564 | #endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ | - |
| 4565 | | - |
| 4566 | #if defined (COND_COMMAND) | - |
| 4567 | static void | - |
| 4568 | cond_error () | - |
| 4569 | { | - |
| 4570 | char *etext; | - |
| 4571 | | - |
| 4572 | if (EOF_Reached && cond_token != COND_ERROR) | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4573 | parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); never executed: parser_error (cond_lineno, dcgettext (((void *)0), "unexpected EOF while looking for `]]'" , 5) ); | 0 |
| 4574 | else if (cond_token != COND_ERROR)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4575 | { | - |
| 4576 | if (etext = error_token_from_token (cond_token))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4577 | { | - |
| 4578 | parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); | - |
| 4579 | free (etext); | - |
| 4580 | } never executed: end of block | 0 |
| 4581 | else | - |
| 4582 | parser_error (cond_lineno, _("syntax error in conditional expression")); never executed: parser_error (cond_lineno, dcgettext (((void *)0), "syntax error in conditional expression" , 5) ); | 0 |
| 4583 | } | - |
| 4584 | } never executed: end of block | 0 |
| 4585 | | - |
| 4586 | static COND_COM * | - |
| 4587 | cond_expr () | - |
| 4588 | { | - |
| 4589 | return (cond_or ()); executed 583 times by 1 test: return (cond_or ()); | 583 |
| 4590 | } | - |
| 4591 | | - |
| 4592 | static COND_COM * | - |
| 4593 | cond_or () | - |
| 4594 | { | - |
| 4595 | COND_COM *l, *r; | - |
| 4596 | | - |
| 4597 | l = cond_and (); | - |
| 4598 | if (cond_token == OR_OR)| TRUE | evaluated 27 times by 1 test | | FALSE | evaluated 583 times by 1 test |
| 27-583 |
| 4599 | { | - |
| 4600 | r = cond_or (); | - |
| 4601 | l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); | - |
| 4602 | }executed 27 times by 1 test: end of block | 27 |
| 4603 | return l;executed 610 times by 1 test: return l; | 610 |
| 4604 | } | - |
| 4605 | | - |
| 4606 | static COND_COM * | - |
| 4607 | cond_and () | - |
| 4608 | { | - |
| 4609 | COND_COM *l, *r; | - |
| 4610 | | - |
| 4611 | l = cond_term (); | - |
| 4612 | if (cond_token == AND_AND)| TRUE | evaluated 71 times by 1 test | | FALSE | evaluated 610 times by 1 test |
| 71-610 |
| 4613 | { | - |
| 4614 | r = cond_and (); | - |
| 4615 | l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); | - |
| 4616 | }executed 71 times by 1 test: end of block | 71 |
| 4617 | return l;executed 681 times by 1 test: return l; | 681 |
| 4618 | } | - |
| 4619 | | - |
| 4620 | static int | - |
| 4621 | cond_skip_newlines () | - |
| 4622 | { | - |
| 4623 | while ((cond_token = read_token (READ)) == '\n')| TRUE | evaluated 20 times by 1 test | | FALSE | evaluated 1309 times by 1 test |
| 20-1309 |
| 4624 | { | - |
| 4625 | if (SHOULD_PROMPT ())| TRUE | never evaluated | | FALSE | evaluated 20 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-20 |
| 4626 | prompt_again (); never executed: prompt_again (); | 0 |
| 4627 | }executed 20 times by 1 test: end of block | 20 |
| 4628 | return (cond_token);executed 1309 times by 1 test: return (cond_token); | 1309 |
| 4629 | } | - |
| 4630 | | - |
| 4631 | #define COND_RETURN_ERROR() \ | - |
| 4632 | do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) | - |
| 4633 | | - |
| 4634 | static COND_COM * | - |
| 4635 | cond_term () | - |
| 4636 | { | - |
| 4637 | WORD_DESC *op; | - |
| 4638 | COND_COM *term, *tleft, *tright; | - |
| 4639 | int tok, lineno; | - |
| 4640 | char *etext; | - |
| 4641 | | - |
| 4642 | | - |
| 4643 | | - |
| 4644 | | - |
| 4645 | tok = cond_skip_newlines (); | - |
| 4646 | lineno = line_number; | - |
| 4647 | if (tok == COND_END)| TRUE | never evaluated | | FALSE | evaluated 693 times by 1 test |
| 0-693 |
| 4648 | { | - |
| 4649 | COND_RETURN_ERROR (); never executed: return ((COND_COM *) ((void *)0) ); | 0 |
| 4650 | } never executed: end of block | 0 |
| 4651 | else if (tok == '(')| TRUE | evaluated 9 times by 1 test | | FALSE | evaluated 684 times by 1 test |
| 9-684 |
| 4652 | { | - |
| 4653 | term = cond_expr (); | - |
| 4654 | if (cond_token != ')')| TRUE | never evaluated | | FALSE | evaluated 9 times by 1 test |
| 0-9 |
| 4655 | { | - |
| 4656 | if (term)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4657 | dispose_cond_node (term); never executed: dispose_cond_node (term); | 0 |
| 4658 | if (etext = error_token_from_token (cond_token))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4659 | { | - |
| 4660 | parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); | - |
| 4661 | free (etext); | - |
| 4662 | } never executed: end of block | 0 |
| 4663 | else | - |
| 4664 | parser_error (lineno, _("expected `)'")); never executed: parser_error (lineno, dcgettext (((void *)0), "expected `)'" , 5) ); | 0 |
| 4665 | COND_RETURN_ERROR (); never executed: return ((COND_COM *) ((void *)0) ); | 0 |
| 4666 | } | - |
| 4667 | term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); | - |
| 4668 | (void)cond_skip_newlines (); | - |
| 4669 | }executed 9 times by 1 test: end of block | 9 |
| 4670 | else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0')))| TRUE | never evaluated | | FALSE | evaluated 684 times by 1 test |
| TRUE | evaluated 684 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 12 times by 1 test | | FALSE | evaluated 672 times by 1 test |
| TRUE | evaluated 12 times by 1 test | | FALSE | never evaluated |
| 0-684 |
| 4671 | { | - |
| 4672 | if (tok == WORD)| TRUE | evaluated 12 times by 1 test | | FALSE | never evaluated |
| 0-12 |
| 4673 | dispose_word (yylval.word); executed 12 times by 1 test: dispose_word (yylval.word); | 12 |
| 4674 | term = cond_term (); | - |
| 4675 | if (term)| TRUE | evaluated 12 times by 1 test | | FALSE | never evaluated |
| 0-12 |
| 4676 | term->flags |= CMD_INVERT_RETURN;executed 12 times by 1 test: term->flags |= 0x04; | 12 |
| 4677 | }executed 12 times by 1 test: end of block | 12 |
| 4678 | else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))| TRUE | evaluated 672 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 132 times by 1 test | | FALSE | evaluated 540 times by 1 test |
| TRUE | evaluated 132 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 132 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 132 times by 1 test | | FALSE | never evaluated |
| 0-672 |
| 4679 | { | - |
| 4680 | op = yylval.word; | - |
| 4681 | tok = read_token (READ); | - |
| 4682 | if (tok == WORD)| TRUE | evaluated 132 times by 1 test | | FALSE | never evaluated |
| 0-132 |
| 4683 | { | - |
| 4684 | tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); | - |
| 4685 | term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); | - |
| 4686 | }executed 132 times by 1 test: end of block | 132 |
| 4687 | else | - |
| 4688 | { | - |
| 4689 | dispose_word (op); | - |
| 4690 | if (etext = error_token_from_token (tok))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4691 | { | - |
| 4692 | parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); | - |
| 4693 | free (etext); | - |
| 4694 | } never executed: end of block | 0 |
| 4695 | else | - |
| 4696 | parser_error (line_number, _("unexpected argument to conditional unary operator")); never executed: parser_error (line_number, dcgettext (((void *)0), "unexpected argument to conditional unary operator" , 5) ); | 0 |
| 4697 | COND_RETURN_ERROR (); never executed: return ((COND_COM *) ((void *)0) ); | 0 |
| 4698 | } | - |
| 4699 | | - |
| 4700 | (void)cond_skip_newlines (); | - |
| 4701 | }executed 132 times by 1 test: end of block | 132 |
| 4702 | else if (tok == WORD) | TRUE | evaluated 540 times by 1 test | | FALSE | never evaluated |
| 0-540 |
| 4703 | { | - |
| 4704 | | - |
| 4705 | tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); | - |
| 4706 | | - |
| 4707 | | - |
| 4708 | tok = read_token (READ); | - |
| 4709 | if (tok == WORD && test_binop (yylval.word->word))| TRUE | evaluated 473 times by 1 test | | FALSE | evaluated 67 times by 1 test |
| TRUE | evaluated 382 times by 1 test | | FALSE | evaluated 91 times by 1 test |
| 67-473 |
| 4710 | { | - |
| 4711 | op = yylval.word; | - |
| 4712 | if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0')))| TRUE | evaluated 242 times by 1 test | | FALSE | evaluated 140 times by 1 test |
| TRUE | evaluated 50 times by 1 test | | FALSE | evaluated 192 times by 1 test |
| TRUE | evaluated 192 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 192 times by 1 test | | FALSE | never evaluated |
| 0-242 |
| 4713 | parser_state |= PST_EXTPAT;executed 242 times by 1 test: parser_state |= 0x001000; | 242 |
| 4714 | else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0')| TRUE | evaluated 46 times by 1 test | | FALSE | evaluated 94 times by 1 test |
| TRUE | evaluated 46 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 46 times by 1 test | | FALSE | never evaluated |
| 0-94 |
| 4715 | parser_state |= PST_EXTPAT;executed 46 times by 1 test: parser_state |= 0x001000; | 46 |
| 4716 | }executed 382 times by 1 test: end of block | 382 |
| 4717 | #if defined (COND_REGEXP) | - |
| 4718 | else if (tok == WORD && STREQ (yylval.word->word, "=~")) never executed: __result = (((const unsigned char *) (const char *) ( yylval.word->word ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "=~" ))[3] - __s2[3]); executed 91 times by 1 test: end of block executed 91 times by 1 test: end of block | TRUE | evaluated 91 times by 1 test | | FALSE | evaluated 67 times by 1 test |
| TRUE | evaluated 91 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 91 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 91 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 91 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 91 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 91 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 91 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-91 |
| 4719 | { | - |
| 4720 | op = yylval.word; | - |
| 4721 | parser_state |= PST_REGEXP; | - |
| 4722 | }executed 91 times by 1 test: end of block | 91 |
| 4723 | #endif | - |
| 4724 | else if (tok == '<' || tok == '>')| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 66 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 65 times by 1 test |
| 1-66 |
| 4725 | op = make_word_from_token (tok); executed 2 times by 1 test: op = make_word_from_token (tok); | 2 |
| 4726 | | - |
| 4727 | | - |
| 4728 | else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')')| TRUE | evaluated 49 times by 1 test | | FALSE | evaluated 16 times by 1 test |
| TRUE | evaluated 12 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 3 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | never evaluated |
| 0-49 |
| 4729 | { | - |
| 4730 | | - |
| 4731 | | - |
| 4732 | | - |
| 4733 | op = make_word ("-n"); | - |
| 4734 | term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); | - |
| 4735 | cond_token = tok; | - |
| 4736 | return (term);executed 65 times by 1 test: return (term); | 65 |
| 4737 | } | - |
| 4738 | else | - |
| 4739 | { | - |
| 4740 | if (etext = error_token_from_token (tok))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4741 | { | - |
| 4742 | parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); | - |
| 4743 | free (etext); | - |
| 4744 | } never executed: end of block | 0 |
| 4745 | else | - |
| 4746 | parser_error (line_number, _("conditional binary operator expected")); never executed: parser_error (line_number, dcgettext (((void *)0), "conditional binary operator expected" , 5) ); | 0 |
| 4747 | dispose_cond_node (tleft); | - |
| 4748 | COND_RETURN_ERROR (); never executed: return ((COND_COM *) ((void *)0) ); | 0 |
| 4749 | } | - |
| 4750 | | - |
| 4751 | | - |
| 4752 | if (parser_state & PST_EXTPAT)| TRUE | evaluated 288 times by 1 test | | FALSE | evaluated 187 times by 1 test |
| 187-288 |
| 4753 | extended_glob = 1;executed 288 times by 1 test: extended_glob = 1; | 288 |
| 4754 | tok = read_token (READ); | - |
| 4755 | if (parser_state & PST_EXTPAT)| TRUE | evaluated 288 times by 1 test | | FALSE | evaluated 187 times by 1 test |
| 187-288 |
| 4756 | extended_glob = global_extglob;executed 288 times by 1 test: extended_glob = global_extglob; | 288 |
| 4757 | parser_state &= ~(PST_REGEXP|PST_EXTPAT); | - |
| 4758 | | - |
| 4759 | if (tok == WORD)| TRUE | evaluated 475 times by 1 test | | FALSE | never evaluated |
| 0-475 |
| 4760 | { | - |
| 4761 | tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); | - |
| 4762 | term = make_cond_node (COND_BINARY, op, tleft, tright); | - |
| 4763 | }executed 475 times by 1 test: end of block | 475 |
| 4764 | else | - |
| 4765 | { | - |
| 4766 | if (etext = error_token_from_token (tok))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4767 | { | - |
| 4768 | parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); | - |
| 4769 | free (etext); | - |
| 4770 | } never executed: end of block | 0 |
| 4771 | else | - |
| 4772 | parser_error (line_number, _("unexpected argument to conditional binary operator")); never executed: parser_error (line_number, dcgettext (((void *)0), "unexpected argument to conditional binary operator" , 5) ); | 0 |
| 4773 | dispose_cond_node (tleft); | - |
| 4774 | dispose_word (op); | - |
| 4775 | COND_RETURN_ERROR (); never executed: return ((COND_COM *) ((void *)0) ); | 0 |
| 4776 | } | - |
| 4777 | | - |
| 4778 | (void)cond_skip_newlines (); | - |
| 4779 | }executed 475 times by 1 test: end of block | 475 |
| 4780 | else | - |
| 4781 | { | - |
| 4782 | if (tok < 256)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4783 | parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); never executed: parser_error (line_number, dcgettext (((void *)0), "unexpected token `%c' in conditional command" , 5) , tok); | 0 |
| 4784 | else if (etext = error_token_from_token (tok))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4785 | { | - |
| 4786 | parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); | - |
| 4787 | free (etext); | - |
| 4788 | } never executed: end of block | 0 |
| 4789 | else | - |
| 4790 | parser_error (line_number, _("unexpected token %d in conditional command"), tok); never executed: parser_error (line_number, dcgettext (((void *)0), "unexpected token %d in conditional command" , 5) , tok); | 0 |
| 4791 | COND_RETURN_ERROR (); never executed: return ((COND_COM *) ((void *)0) ); | 0 |
| 4792 | } | - |
| 4793 | return (term);executed 628 times by 1 test: return (term); | 628 |
| 4794 | } | - |
| 4795 | | - |
| 4796 | | - |
| 4797 | | - |
| 4798 | static COMMAND * | - |
| 4799 | parse_cond_command () | - |
| 4800 | { | - |
| 4801 | COND_COM *cexp; | - |
| 4802 | | - |
| 4803 | global_extglob = extended_glob; | - |
| 4804 | cexp = cond_expr (); | - |
| 4805 | return (make_cond_command (cexp));executed 574 times by 1 test: return (make_cond_command (cexp)); | 574 |
| 4806 | } | - |
| 4807 | #endif | - |
| 4808 | | - |
| 4809 | #if defined (ARRAY_VARS) | - |
| 4810 | | - |
| 4811 | | - |
| 4812 | | - |
| 4813 | | - |
| 4814 | | - |
| 4815 | static int | - |
| 4816 | token_is_assignment (t, i) | - |
| 4817 | char *t; | - |
| 4818 | int i; | - |
| 4819 | { | - |
| 4820 | int r; | - |
| 4821 | char *atoken; | - |
| 4822 | | - |
| 4823 | atoken = xmalloc (i + 3); | - |
| 4824 | memcpy (atoken, t, i); | - |
| 4825 | atoken[i] = '='; | - |
| 4826 | atoken[i+1] = '\0'; | - |
| 4827 | | - |
| 4828 | r = assignment (atoken, (parser_state & PST_COMPASSIGN) != 0); | - |
| 4829 | | - |
| 4830 | free (atoken); | - |
| 4831 | | - |
| 4832 | | - |
| 4833 | | - |
| 4834 | return (r > 0 && r == i);executed 119104 times by 1 test: return (r > 0 && r == i); | 119104 |
| 4835 | } | - |
| 4836 | | - |
| 4837 | | - |
| 4838 | static int | - |
| 4839 | token_is_ident (t, i) | - |
| 4840 | char *t; | - |
| 4841 | int i; | - |
| 4842 | { | - |
| 4843 | unsigned char c; | - |
| 4844 | int r; | - |
| 4845 | | - |
| 4846 | c = t[i]; | - |
| 4847 | t[i] = '\0'; | - |
| 4848 | r = legal_identifier (t); | - |
| 4849 | t[i] = c; | - |
| 4850 | return r;executed 967 times by 1 test: return r; | 967 |
| 4851 | } | - |
| 4852 | #endif | - |
| 4853 | | - |
| 4854 | static int | - |
| 4855 | read_token_word (character) | - |
| 4856 | int character; | - |
| 4857 | { | - |
| 4858 | | - |
| 4859 | WORD_DESC *the_word; | - |
| 4860 | | - |
| 4861 | | - |
| 4862 | int token_index; | - |
| 4863 | | - |
| 4864 | | - |
| 4865 | int all_digit_token; | - |
| 4866 | | - |
| 4867 | | - |
| 4868 | int dollar_present; | - |
| 4869 | | - |
| 4870 | | - |
| 4871 | | - |
| 4872 | int compound_assignment; | - |
| 4873 | | - |
| 4874 | | - |
| 4875 | int quoted; | - |
| 4876 | | - |
| 4877 | | - |
| 4878 | | - |
| 4879 | int pass_next_character; | - |
| 4880 | | - |
| 4881 | | - |
| 4882 | int cd; | - |
| 4883 | int result, peek_char; | - |
| 4884 | char *ttok, *ttrans; | - |
| 4885 | int ttoklen, ttranslen; | - |
| 4886 | intmax_t lvalue; | - |
| 4887 | | - |
| 4888 | if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE)| TRUE | evaluated 713316 times by 1 test | | FALSE | evaluated 2160912 times by 1 test |
| 713316-2160912 |
| 4889 | token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE);executed 713316 times by 1 test: token = (char *)sh_xrealloc((token), (token_buffer_size = 496), "./parse.y", 4889); | 713316 |
| 4890 | | - |
| 4891 | token_index = 0; | - |
| 4892 | all_digit_token = DIGIT (character);| TRUE | evaluated 2354832 times by 1 test | | FALSE | evaluated 519396 times by 1 test |
| TRUE | evaluated 93549 times by 1 test | | FALSE | evaluated 2261283 times by 1 test |
| 93549-2354832 |
| 4893 | dollar_present = quoted = pass_next_character = compound_assignment = 0; | - |
| 4894 | | - |
| 4895 | for (;;) | - |
| 4896 | { | - |
| 4897 | if (character == EOF)| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 11138507 times by 1 test |
| 3-11138507 |
| 4898 | goto got_token;executed 3 times by 1 test: goto got_token; | 3 |
| 4899 | | - |
| 4900 | if (pass_next_character)| TRUE | evaluated 1260 times by 1 test | | FALSE | evaluated 11137247 times by 1 test |
| 1260-11137247 |
| 4901 | { | - |
| 4902 | pass_next_character = 0; | - |
| 4903 | goto got_escaped_character;executed 1260 times by 1 test: goto got_escaped_character; | 1260 |
| 4904 | } | - |
| 4905 | | - |
| 4906 | cd = current_delimiter (dstack);| TRUE | never evaluated | | FALSE | evaluated 11137247 times by 1 test |
| 0-11137247 |
| 4907 | | - |
| 4908 | | - |
| 4909 | | - |
| 4910 | if MBTEST(character == '\\')| TRUE | evaluated 1243 times by 1 test | | FALSE | evaluated 17 times by 1 test |
| TRUE | evaluated 1260 times by 1 test | | FALSE | evaluated 11135987 times by 1 test |
| TRUE | evaluated 1260 times by 1 test | | FALSE | never evaluated |
| 0-11135987 |
| 4911 | { | - |
| 4912 | peek_char = shell_getc (0); | - |
| 4913 | | - |
| 4914 | | - |
| 4915 | | - |
| 4916 | if (peek_char == '\n')| TRUE | never evaluated | | FALSE | evaluated 1260 times by 1 test |
| 0-1260 |
| 4917 | { | - |
| 4918 | character = '\n'; | - |
| 4919 | goto next_character; never executed: goto next_character; | 0 |
| 4920 | } | - |
| 4921 | else | - |
| 4922 | { | - |
| 4923 | shell_ungetc (peek_char); | - |
| 4924 | | - |
| 4925 | | - |
| 4926 | if (cd == 0 || cd == '`' ||| TRUE | evaluated 1260 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-1260 |
| 4927 | (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE)))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 4928 | pass_next_character++;executed 1260 times by 1 test: pass_next_character++; | 1260 |
| 4929 | | - |
| 4930 | quoted = 1; | - |
| 4931 | goto got_character;executed 1260 times by 1 test: goto got_character; | 1260 |
| 4932 | } | - |
| 4933 | } | - |
| 4934 | | - |
| 4935 | | - |
| 4936 | if MBTEST(shellquote (character))| TRUE | evaluated 364499 times by 1 test | | FALSE | evaluated 153 times by 1 test |
| TRUE | evaluated 364652 times by 1 test | | FALSE | evaluated 10771335 times by 1 test |
| TRUE | evaluated 364652 times by 1 test | | FALSE | never evaluated |
| 0-10771335 |
| 4937 | { | - |
| 4938 | push_delimiter (dstack, character);executed 3294 times by 1 test: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 4938); | TRUE | evaluated 3294 times by 1 test | | FALSE | evaluated 361358 times by 1 test |
| 3294-361358 |
| 4939 | ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); | - |
| 4940 | pop_delimiter (dstack); | - |
| 4941 | if (ttok == &matched_pair_error)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 364651 times by 1 test |
| 1-364651 |
| 4942 | return -1; executed 1 time by 1 test: return -1; | 1 |
| 4943 | RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 364651 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-364651 |
| 4944 | token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); | - |
| 4945 | token[token_index++] = character; | - |
| 4946 | strcpy (token + token_index, ttok); | - |
| 4947 | token_index += ttoklen; | - |
| 4948 | all_digit_token = 0; | - |
| 4949 | quoted = 1; | - |
| 4950 | dollar_present |= (character == '"' && strchr (ttok, '$') != 0);| TRUE | evaluated 146931 times by 1 test | | FALSE | evaluated 217720 times by 1 test |
| TRUE | evaluated 115125 times by 1 test | | FALSE | evaluated 31806 times by 1 test |
| TRUE | evaluated 146931 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 146931 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 146931 times by 1 test |
| 0-217720 |
| 4951 | FREE (ttok);executed 364651 times by 1 test: sh_xfree((ttok), "./parse.y", 4951); | TRUE | evaluated 364651 times by 1 test | | FALSE | never evaluated |
| 0-364651 |
| 4952 | goto next_character;executed 364651 times by 1 test: goto next_character; | 364651 |
| 4953 | } | - |
| 4954 | | - |
| 4955 | #ifdef COND_REGEXP | - |
| 4956 | | - |
| 4957 | | - |
| 4958 | | - |
| 4959 | if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) | TRUE | evaluated 28 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 459 times by 1 test | | FALSE | evaluated 10770876 times by 1 test |
| TRUE | evaluated 28 times by 1 test | | FALSE | evaluated 431 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 431 times by 1 test |
| TRUE | evaluated 28 times by 1 test | | FALSE | never evaluated |
| 0-10770876 |
| 4960 | { | - |
| 4961 | if (character == '|')| TRUE | never evaluated | | FALSE | evaluated 28 times by 1 test |
| 0-28 |
| 4962 | goto got_character; never executed: goto got_character; | 0 |
| 4963 | | - |
| 4964 | push_delimiter (dstack, character); never executed: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 4964); | TRUE | never evaluated | | FALSE | evaluated 28 times by 1 test |
| 0-28 |
| 4965 | ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); | - |
| 4966 | pop_delimiter (dstack); | - |
| 4967 | if (ttok == &matched_pair_error)| TRUE | never evaluated | | FALSE | evaluated 28 times by 1 test |
| 0-28 |
| 4968 | return -1; never executed: return -1; | 0 |
| 4969 | RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 28 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-28 |
| 4970 | token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); | - |
| 4971 | token[token_index++] = character; | - |
| 4972 | strcpy (token + token_index, ttok); | - |
| 4973 | token_index += ttoklen; | - |
| 4974 | FREE (ttok);executed 28 times by 1 test: sh_xfree((ttok), "./parse.y", 4974); | TRUE | evaluated 28 times by 1 test | | FALSE | never evaluated |
| 0-28 |
| 4975 | dollar_present = all_digit_token = 0; | - |
| 4976 | goto next_character;executed 28 times by 1 test: goto next_character; | 28 |
| 4977 | } | - |
| 4978 | #endif /* COND_REGEXP */ | - |
| 4979 | | - |
| 4980 | #ifdef EXTENDED_GLOB | - |
| 4981 | | - |
| 4982 | if MBTEST(extended_glob && PATTERN_CHAR (character))| TRUE | evaluated 702 times by 1 test | | FALSE | evaluated 67 times by 1 test |
| TRUE | evaluated 49661 times by 1 test | | FALSE | evaluated 10721646 times by 1 test |
| TRUE | evaluated 70 times by 1 test | | FALSE | evaluated 49591 times by 1 test |
| TRUE | evaluated 412 times by 1 test | | FALSE | evaluated 49179 times by 1 test |
| TRUE | evaluated 145 times by 1 test | | FALSE | evaluated 49034 times by 1 test |
| TRUE | evaluated 66 times by 1 test | | FALSE | evaluated 48968 times by 1 test |
| TRUE | evaluated 76 times by 1 test | | FALSE | evaluated 48892 times by 1 test |
| TRUE | evaluated 769 times by 1 test | | FALSE | never evaluated |
| 0-10721646 |
| 4983 | { | - |
| 4984 | peek_char = shell_getc (1); | - |
| 4985 | if MBTEST(peek_char == '(') | TRUE | evaluated 199 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 199 times by 1 test | | FALSE | evaluated 570 times by 1 test |
| TRUE | evaluated 199 times by 1 test | | FALSE | never evaluated |
| 0-570 |
| 4986 | { | - |
| 4987 | push_delimiter (dstack, peek_char);executed 4 times by 1 test: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 4987); | TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 195 times by 1 test |
| 4-195 |
| 4988 | ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); | - |
| 4989 | pop_delimiter (dstack); | - |
| 4990 | if (ttok == &matched_pair_error)| TRUE | never evaluated | | FALSE | evaluated 199 times by 1 test |
| 0-199 |
| 4991 | return -1; never executed: return -1; | 0 |
| 4992 | RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 199 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-199 |
| 4993 | token_buffer_size, | - |
| 4994 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 4995 | token[token_index++] = character; | - |
| 4996 | token[token_index++] = peek_char; | - |
| 4997 | strcpy (token + token_index, ttok); | - |
| 4998 | token_index += ttoklen; | - |
| 4999 | FREE (ttok);executed 199 times by 1 test: sh_xfree((ttok), "./parse.y", 4999); | TRUE | evaluated 199 times by 1 test | | FALSE | never evaluated |
| 0-199 |
| 5000 | dollar_present = all_digit_token = 0; | - |
| 5001 | goto next_character;executed 199 times by 1 test: goto next_character; | 199 |
| 5002 | } | - |
| 5003 | else | - |
| 5004 | shell_ungetc (peek_char);executed 570 times by 1 test: shell_ungetc (peek_char); | 570 |
| 5005 | } | - |
| 5006 | #endif /* EXTENDED_GLOB */ | - |
| 5007 | | - |
| 5008 | | - |
| 5009 | | - |
| 5010 | if (shellexp (character))| TRUE | evaluated 189730 times by 1 test | | FALSE | evaluated 10581378 times by 1 test |
| TRUE | evaluated 17717 times by 1 test | | FALSE | evaluated 10563661 times by 1 test |
| TRUE | evaluated 6739 times by 1 test | | FALSE | evaluated 10556922 times by 1 test |
| 6739-10581378 |
| 5011 | { | - |
| 5012 | peek_char = shell_getc (1); | - |
| 5013 | | - |
| 5014 | if MBTEST(peek_char == '(' ||| TRUE | evaluated 37971 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 23338 times by 1 test | | FALSE | evaluated 190848 times by 1 test |
| TRUE | evaluated 14630 times by 1 test | | FALSE | evaluated 176218 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 176215 times by 1 test |
| TRUE | evaluated 14633 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 37971 times by 1 test | | FALSE | never evaluated |
| 0-190848 |
| 5015 | ((peek_char == '{' || peek_char == '[') && character == '$')) | - |
| 5016 | { | - |
| 5017 | if (peek_char == '{') | TRUE | evaluated 14630 times by 1 test | | FALSE | evaluated 23341 times by 1 test |
| 14630-23341 |
| 5018 | ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE);executed 14630 times by 1 test: ttok = parse_matched_pair (cd, '{', '}', &ttoklen, 0x0001|0x0040); | 14630 |
| 5019 | else if (peek_char == '(') | TRUE | evaluated 23338 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| 3-23338 |
| 5020 | { | - |
| 5021 | | - |
| 5022 | | - |
| 5023 | | - |
| 5024 | | - |
| 5025 | | - |
| 5026 | push_delimiter (dstack, peek_char);executed 1509 times by 1 test: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 5026); | TRUE | evaluated 1509 times by 1 test | | FALSE | evaluated 21829 times by 1 test |
| 1509-21829 |
| 5027 | ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); | - |
| 5028 | pop_delimiter (dstack); | - |
| 5029 | }executed 23338 times by 1 test: end of block | 23338 |
| 5030 | else | - |
| 5031 | ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0);executed 3 times by 1 test: ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); | 3 |
| 5032 | if (ttok == &matched_pair_error)| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 37967 times by 1 test |
| 4-37967 |
| 5033 | return -1; executed 4 times by 1 test: return -1; | 4 |
| 5034 | RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 37967 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-37967 |
| 5035 | token_buffer_size, | - |
| 5036 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5037 | token[token_index++] = character; | - |
| 5038 | token[token_index++] = peek_char; | - |
| 5039 | strcpy (token + token_index, ttok); | - |
| 5040 | token_index += ttoklen; | - |
| 5041 | FREE (ttok);executed 37967 times by 1 test: sh_xfree((ttok), "./parse.y", 5041); | TRUE | evaluated 37967 times by 1 test | | FALSE | never evaluated |
| 0-37967 |
| 5042 | dollar_present = 1; | - |
| 5043 | all_digit_token = 0; | - |
| 5044 | goto next_character;executed 37967 times by 1 test: goto next_character; | 37967 |
| 5045 | } | - |
| 5046 | | - |
| 5047 | else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"'))| TRUE | evaluated 2530 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 170218 times by 1 test | | FALSE | evaluated 5997 times by 1 test |
| TRUE | evaluated 2495 times by 1 test | | FALSE | evaluated 167723 times by 1 test |
| TRUE | evaluated 35 times by 1 test | | FALSE | evaluated 167688 times by 1 test |
| TRUE | evaluated 2530 times by 1 test | | FALSE | never evaluated |
| 0-170218 |
| 5048 | { | - |
| 5049 | int first_line; | - |
| 5050 | | - |
| 5051 | first_line = line_number; | - |
| 5052 | push_delimiter (dstack, peek_char);executed 44 times by 1 test: dstack.delimiters = (char *)sh_xrealloc((dstack.delimiters), ((dstack.delimiter_space += 10) * sizeof (char)), "./parse.y", 5052); | TRUE | evaluated 44 times by 1 test | | FALSE | evaluated 2486 times by 1 test |
| 44-2486 |
| 5053 | ttok = parse_matched_pair (peek_char, peek_char, peek_char, | - |
| 5054 | &ttoklen, | - |
| 5055 | (peek_char == '\'') ? P_ALLOWESC : 0); | - |
| 5056 | pop_delimiter (dstack); | - |
| 5057 | if (ttok == &matched_pair_error)| TRUE | never evaluated | | FALSE | evaluated 2530 times by 1 test |
| 0-2530 |
| 5058 | return -1; never executed: return -1; | 0 |
| 5059 | if (peek_char == '\'')| TRUE | evaluated 2495 times by 1 test | | FALSE | evaluated 35 times by 1 test |
| 35-2495 |
| 5060 | { | - |
| 5061 | ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); | - |
| 5062 | free (ttok); | - |
| 5063 | | - |
| 5064 | | - |
| 5065 | | - |
| 5066 | | - |
| 5067 | ttok = sh_single_quote (ttrans); | - |
| 5068 | free (ttrans); | - |
| 5069 | ttranslen = strlen (ttok); | - |
| 5070 | ttrans = ttok; | - |
| 5071 | }executed 2495 times by 1 test: end of block | 2495 |
| 5072 | else | - |
| 5073 | { | - |
| 5074 | | - |
| 5075 | ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); | - |
| 5076 | free (ttok); | - |
| 5077 | | - |
| 5078 | | - |
| 5079 | ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); | - |
| 5080 | free (ttrans); | - |
| 5081 | ttranslen += 2; | - |
| 5082 | ttrans = ttok; | - |
| 5083 | }executed 35 times by 1 test: end of block | 35 |
| 5084 | | - |
| 5085 | RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 2530 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-2530 |
| 5086 | token_buffer_size, | - |
| 5087 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5088 | strcpy (token + token_index, ttrans); | - |
| 5089 | token_index += ttranslen; | - |
| 5090 | FREE (ttrans);executed 2530 times by 1 test: sh_xfree((ttrans), "./parse.y", 5090); | TRUE | evaluated 2530 times by 1 test | | FALSE | never evaluated |
| 0-2530 |
| 5091 | quoted = 1; | - |
| 5092 | all_digit_token = 0; | - |
| 5093 | goto next_character;executed 2530 times by 1 test: goto next_character; | 2530 |
| 5094 | } | - |
| 5095 | | - |
| 5096 | | - |
| 5097 | else if MBTEST(character == '$' && peek_char == '$')| TRUE | evaluated 1253 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 167688 times by 1 test | | FALSE | evaluated 5997 times by 1 test |
| TRUE | evaluated 1253 times by 1 test | | FALSE | evaluated 166435 times by 1 test |
| TRUE | evaluated 1253 times by 1 test | | FALSE | never evaluated |
| 0-167688 |
| 5098 | { | - |
| 5099 | RESIZE_MALLOCED_BUFFER (token, token_index, 3, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 1253 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-1253 |
| 5100 | token_buffer_size, | - |
| 5101 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5102 | token[token_index++] = '$'; | - |
| 5103 | token[token_index++] = peek_char; | - |
| 5104 | dollar_present = 1; | - |
| 5105 | all_digit_token = 0; | - |
| 5106 | goto next_character;executed 1253 times by 1 test: goto next_character; | 1253 |
| 5107 | } | - |
| 5108 | else | - |
| 5109 | shell_ungetc (peek_char);executed 172432 times by 1 test: shell_ungetc (peek_char); | 172432 |
| 5110 | } | - |
| 5111 | | - |
| 5112 | #if defined (ARRAY_VARS) | - |
| 5113 | | - |
| 5114 | | - |
| 5115 | | - |
| 5116 | else if MBTEST(character == '[' && | TRUE | evaluated 4440 times by 1 test | | FALSE | evaluated 126 times by 1 test |
| TRUE | evaluated 6788 times by 1 test | | FALSE | evaluated 10550134 times by 1 test |
| TRUE | evaluated 1459 times by 1 test | | FALSE | evaluated 5329 times by 1 test |
| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 1454 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1454 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 1454 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1454 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1454 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1049 times by 1 test | | FALSE | evaluated 405 times by 1 test |
| TRUE | evaluated 967 times by 1 test | | FALSE | evaluated 87 times by 1 test |
| TRUE | evaluated 391 times by 1 test | | FALSE | evaluated 576 times by 1 test |
| TRUE | evaluated 5329 times by 1 test | | FALSE | evaluated 1068 times by 1 test |
| TRUE | evaluated 4175 times by 1 test | | FALSE | evaluated 1154 times by 1 test |
| TRUE | evaluated 4566 times by 1 test | | FALSE | never evaluated |
| 0-10550134 |
| 5117 | ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || | - |
| 5118 | (token_index == 0 && (parser_state&PST_COMPASSIGN)))) | - |
| 5119 | { | - |
| 5120 | ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); | - |
| 5121 | if (ttok == &matched_pair_error)| TRUE | never evaluated | | FALSE | evaluated 4566 times by 1 test |
| 0-4566 |
| 5122 | return -1; never executed: return -1; | 0 |
| 5123 | RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 4566 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-4566 |
| 5124 | token_buffer_size, | - |
| 5125 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5126 | token[token_index++] = character; | - |
| 5127 | strcpy (token + token_index, ttok); | - |
| 5128 | token_index += ttoklen; | - |
| 5129 | FREE (ttok);executed 4566 times by 1 test: sh_xfree((ttok), "./parse.y", 5129); | TRUE | evaluated 4566 times by 1 test | | FALSE | never evaluated |
| 0-4566 |
| 5130 | all_digit_token = 0; | - |
| 5131 | goto next_character;executed 4566 times by 1 test: goto next_character; | 4566 |
| 5132 | } | - |
| 5133 | | - |
| 5134 | else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index))| TRUE | evaluated 119028 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 129193 times by 1 test | | FALSE | evaluated 10423163 times by 1 test |
| TRUE | evaluated 128405 times by 1 test | | FALSE | evaluated 788 times by 1 test |
| TRUE | evaluated 9187 times by 1 test | | FALSE | evaluated 119218 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 119215 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | evaluated 119215 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 119215 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 119215 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 106048 times by 1 test | | FALSE | evaluated 13167 times by 1 test |
| TRUE | evaluated 115231 times by 1 test | | FALSE | evaluated 7 times by 1 test |
| TRUE | evaluated 3873 times by 1 test | | FALSE | evaluated 9301 times by 1 test |
| TRUE | evaluated 119028 times by 1 test | | FALSE | evaluated 76 times by 1 test |
| TRUE | evaluated 119028 times by 1 test | | FALSE | never evaluated |
| 0-10423163 |
| 5135 | { | - |
| 5136 | peek_char = shell_getc (1); | - |
| 5137 | if MBTEST(peek_char == '(') | TRUE | evaluated 725 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 725 times by 1 test | | FALSE | evaluated 118303 times by 1 test |
| TRUE | evaluated 725 times by 1 test | | FALSE | never evaluated |
| 0-118303 |
| 5138 | { | - |
| 5139 | ttok = parse_compound_assignment (&ttoklen); | - |
| 5140 | | - |
| 5141 | RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4,executed 38 times by 1 test: token_buffer_size += (512); executed 2 times by 1 test: end of block | TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 706 times by 1 test |
| TRUE | evaluated 38 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-706 |
| 5142 | token_buffer_size, | - |
| 5143 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5144 | | - |
| 5145 | token[token_index++] = '='; | - |
| 5146 | token[token_index++] = '('; | - |
| 5147 | if (ttok)| TRUE | evaluated 644 times by 1 test | | FALSE | evaluated 64 times by 1 test |
| 64-644 |
| 5148 | { | - |
| 5149 | strcpy (token + token_index, ttok); | - |
| 5150 | token_index += ttoklen; | - |
| 5151 | }executed 644 times by 1 test: end of block | 644 |
| 5152 | token[token_index++] = ')'; | - |
| 5153 | FREE (ttok);executed 644 times by 1 test: sh_xfree((ttok), "./parse.y", 5153); | TRUE | evaluated 644 times by 1 test | | FALSE | evaluated 64 times by 1 test |
| 64-644 |
| 5154 | all_digit_token = 0; | - |
| 5155 | compound_assignment = 1; | - |
| 5156 | #if 1 | - |
| 5157 | goto next_character;executed 708 times by 1 test: goto next_character; | 708 |
| 5158 | #else | - |
| 5159 | goto got_token; | - |
| 5160 | #endif | - |
| 5161 | } | - |
| 5162 | else | - |
| 5163 | shell_ungetc (peek_char);executed 118303 times by 1 test: shell_ungetc (peek_char); | 118303 |
| 5164 | } | - |
| 5165 | #endif | - |
| 5166 | | - |
| 5167 | | - |
| 5168 | | - |
| 5169 | if MBTEST(shellbreak (character))| TRUE | evaluated 2874166 times by 1 test | | FALSE | evaluated 37 times by 1 test |
| TRUE | evaluated 2874203 times by 1 test | | FALSE | evaluated 7849860 times by 1 test |
| TRUE | evaluated 2874203 times by 1 test | | FALSE | never evaluated |
| 0-7849860 |
| 5170 | { | - |
| 5171 | shell_ungetc (character); | - |
| 5172 | goto got_token;executed 2874203 times by 1 test: goto got_token; | 2874203 |
| 5173 | } | - |
| 5174 | | - |
| 5175 | got_character:code before this statement executed 7849860 times by 1 test: got_character: | 7849860 |
| 5176 | if (character == CTLESC || character == CTLNUL)| TRUE | evaluated 19 times by 1 test | | FALSE | evaluated 7851101 times by 1 test |
| TRUE | evaluated 18 times by 1 test | | FALSE | evaluated 7851083 times by 1 test |
| 18-7851101 |
| 5177 | { | - |
| 5178 | RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, never executed: token_buffer_size += (512); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 37 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-37 |
| 5179 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5180 | token[token_index++] = CTLESC; | - |
| 5181 | }executed 37 times by 1 test: end of block | 37 |
| 5182 | else | - |
| 5183 | got_escaped_character: | - |
| 5184 | RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size,executed 195 times by 1 test: token_buffer_size += (512); executed 195 times by 1 test: end of block executed 7852343 times by 1 test: end of block | TRUE | evaluated 195 times by 1 test | | FALSE | evaluated 7852148 times by 1 test |
| TRUE | evaluated 195 times by 1 test | | FALSE | evaluated 195 times by 1 test |
| 195-7852343 |
| 5185 | TOKEN_DEFAULT_GROW_SIZE); | - |
| 5186 | | - |
| 5187 | token[token_index++] = character; | - |
| 5188 | | - |
| 5189 | all_digit_token &= DIGIT (character);| TRUE | evaluated 7522018 times by 1 test | | FALSE | evaluated 330362 times by 1 test |
| TRUE | evaluated 278894 times by 1 test | | FALSE | evaluated 7243124 times by 1 test |
| 278894-7522018 |
| 5190 | dollar_present |= character == '$'; | - |
| 5191 | | - |
| 5192 | next_character:code before this statement executed 7852380 times by 1 test: next_character: | 7852380 |
| 5193 | if (character == '\n' && SHOULD_PROMPT ())| TRUE | never evaluated | | FALSE | evaluated 8264282 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-8264282 |
| 5194 | prompt_again (); never executed: prompt_again (); | 0 |
| 5195 | | - |
| 5196 | | - |
| 5197 | | - |
| 5198 | | - |
| 5199 | cd = current_delimiter (dstack);| TRUE | never evaluated | | FALSE | evaluated 8264282 times by 1 test |
| 0-8264282 |
| 5200 | character = shell_getc (cd != '\'' && pass_next_character == 0); | - |
| 5201 | } executed 8264282 times by 1 test: end of block | 8264282 |
| 5202 | | - |
| 5203 | got_token: code before this statement never executed: got_token: | 0 |
| 5204 | | - |
| 5205 | | - |
| 5206 | token[token_index] = '\0'; | - |
| 5207 | | - |
| 5208 | | - |
| 5209 | | - |
| 5210 | | - |
| 5211 | | - |
| 5212 | if MBTEST(all_digit_token && (character == '<' || character == '>' ||| TRUE | evaluated 27204 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 93125 times by 1 test | | FALSE | evaluated 2781081 times by 1 test |
| TRUE | evaluated 1484 times by 1 test | | FALSE | evaluated 91641 times by 1 test |
| TRUE | evaluated 4430 times by 1 test | | FALSE | evaluated 87211 times by 1 test |
| TRUE | evaluated 30 times by 1 test | | FALSE | evaluated 87181 times by 1 test |
| TRUE | evaluated 21260 times by 1 test | | FALSE | evaluated 65921 times by 1 test |
| TRUE | evaluated 27204 times by 1 test | | FALSE | never evaluated |
| 0-2781081 |
| 5213 | last_read_token == LESS_AND || | - |
| 5214 | last_read_token == GREATER_AND)) | - |
| 5215 | { | - |
| 5216 | if (legal_number (token, &lvalue) && (int)lvalue == lvalue)| TRUE | evaluated 27196 times by 1 test | | FALSE | evaluated 8 times by 1 test |
| TRUE | evaluated 27196 times by 1 test | | FALSE | never evaluated |
| 0-27196 |
| 5217 | { | - |
| 5218 | yylval.number = lvalue; | - |
| 5219 | return (NUMBER);executed 27196 times by 1 test: return (284); | 27196 |
| 5220 | } | - |
| 5221 | }executed 8 times by 1 test: end of block | 8 |
| 5222 | | - |
| 5223 | | - |
| 5224 | result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1;| TRUE | evaluated 2847007 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| TRUE | evaluated 2830960 times by 1 test | | FALSE | evaluated 16050 times by 1 test |
| 3-2847007 |
| 5225 | if (result >= 0)| TRUE | evaluated 128189 times by 1 test | | FALSE | evaluated 2718821 times by 1 test |
| 128189-2718821 |
| 5226 | return result;executed 128189 times by 1 test: return result; | 128189 |
| 5227 | | - |
| 5228 | #if defined (ALIAS) | - |
| 5229 | | - |
| 5230 | | - |
| 5231 | | - |
| 5232 | if MBTEST(posixly_correct)| TRUE | evaluated 9758 times by 1 test | | FALSE | evaluated 12 times by 1 test |
| TRUE | evaluated 9770 times by 1 test | | FALSE | evaluated 2709051 times by 1 test |
| TRUE | evaluated 9770 times by 1 test | | FALSE | never evaluated |
| 0-2709051 |
| 5233 | CHECK_FOR_RESERVED_WORD (token); never executed: __result = (((const unsigned char *) (const char *) ( token ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( word_token_alist[i].word ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: break; never executed: break; never executed: break; executed 1 time by 1 test: parser_state &= ~(0x000001|0x000080); executed 1 time by 1 test: parser_state |= 0x000080; never executed: parser_state &= ~(0x000100|0x000200); executed 6 times by 1 test: parser_state |= 0x000100; executed 1 time by 1 test: open_brace_count++; never executed: open_brace_count--; executed 35 times by 1 test: return (word_token_alist[i].token); executed 3133 times by 1 test: end of block executed 9735 times by 1 test: end of block | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 34 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 33 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 33 times by 1 test |
| TRUE | evaluated 6 times by 1 test | | FALSE | evaluated 27 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 26 times by 1 test |
| TRUE | evaluated 69188 times by 1 test | | FALSE | evaluated 3133 times by 1 test |
| TRUE | evaluated 8418 times by 1 test | | FALSE | evaluated 1352 times by 1 test |
| TRUE | evaluated 7842 times by 1 test | | FALSE | evaluated 576 times by 1 test |
| TRUE | evaluated 3168 times by 1 test | | FALSE | evaluated 4674 times by 1 test |
| TRUE | evaluated 7297 times by 1 test | | FALSE | evaluated 61891 times by 1 test |
| TRUE | evaluated 35 times by 1 test | | FALSE | evaluated 7262 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 34 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 35 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 34 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 26 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-69188 |
| 5234 | | - |
| 5235 | | - |
| 5236 | | - |
| 5237 | if (expand_aliases && quoted == 0)| TRUE | evaluated 18628 times by 1 test | | FALSE | evaluated 2700158 times by 1 test |
| TRUE | evaluated 16242 times by 1 test | | FALSE | evaluated 2386 times by 1 test |
| 2386-2700158 |
| 5238 | { | - |
| 5239 | result = alias_expand_token (token); | - |
| 5240 | if (result == RE_READ_TOKEN)| TRUE | evaluated 82 times by 1 test | | FALSE | evaluated 16160 times by 1 test |
| 82-16160 |
| 5241 | return (RE_READ_TOKEN);executed 82 times by 1 test: return (-99); | 82 |
| 5242 | else if (result == NO_EXPANSION)| TRUE | evaluated 16160 times by 1 test | | FALSE | never evaluated |
| 0-16160 |
| 5243 | parser_state &= ~PST_ALEXPNEXT;executed 16160 times by 1 test: parser_state &= ~0x000002; | 16160 |
| 5244 | }executed 16160 times by 1 test: end of block | 16160 |
| 5245 | | - |
| 5246 | | - |
| 5247 | | - |
| 5248 | if MBTEST(posixly_correct == 0)| TRUE | evaluated 2705105 times by 1 test | | FALSE | evaluated 3864 times by 1 test |
| TRUE | evaluated 2708969 times by 1 test | | FALSE | evaluated 9735 times by 1 test |
| TRUE | evaluated 2708966 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| 3-2708969 |
| 5249 | #endif | - |
| 5250 | CHECK_FOR_RESERVED_WORD (token); never executed: __result = (((const unsigned char *) (const char *) ( token ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( word_token_alist[i].word ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: break; never executed: break; executed 2 times by 1 test: break; executed 78108 times by 1 test: parser_state &= ~(0x000001|0x000080); executed 78111 times by 1 test: parser_state |= 0x000080; never executed: parser_state &= ~(0x000100|0x000200); executed 568 times by 1 test: parser_state |= 0x000100; executed 824 times by 1 test: open_brace_count++; never executed: open_brace_count--; executed 262804 times by 1 test: return (word_token_alist[i].token); executed 1056929 times by 1 test: end of block executed 2446162 times by 1 test: end of block | TRUE | evaluated 78108 times by 1 test | | FALSE | evaluated 184696 times by 1 test |
| TRUE | evaluated 78111 times by 1 test | | FALSE | evaluated 106585 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 106585 times by 1 test |
| TRUE | evaluated 568 times by 1 test | | FALSE | evaluated 106017 times by 1 test |
| TRUE | evaluated 824 times by 1 test | | FALSE | evaluated 105193 times by 1 test |
| TRUE | evaluated 25421298 times by 1 test | | FALSE | evaluated 1056927 times by 1 test |
| TRUE | evaluated 2420992 times by 1 test | | FALSE | evaluated 287974 times by 1 test |
| TRUE | evaluated 2169380 times by 1 test | | FALSE | evaluated 251612 times by 1 test |
| TRUE | evaluated 1319733 times by 1 test | | FALSE | evaluated 849647 times by 1 test |
| TRUE | evaluated 2951772 times by 1 test | | FALSE | evaluated 22469526 times by 1 test |
| TRUE | evaluated 262806 times by 1 test | | FALSE | evaluated 2688966 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 75603 times by 1 test | | FALSE | evaluated 187203 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 75603 times by 1 test |
| TRUE | evaluated 15 times by 1 test | | FALSE | evaluated 262791 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 15 times by 1 test |
| TRUE | evaluated 75603 times by 1 test | | FALSE | evaluated 187203 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 75601 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 105193 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-25421298 |
| 5251 | | - |
| 5252 | the_word = alloc_word_desc (); | - |
| 5253 | the_word->word = (char *)xmalloc (1 + token_index); | - |
| 5254 | the_word->flags = 0; | - |
| 5255 | strcpy (the_word->word, token); | - |
| 5256 | if (dollar_present)| TRUE | evaluated 289326 times by 1 test | | FALSE | evaluated 2166574 times by 1 test |
| 289326-2166574 |
| 5257 | the_word->flags |= W_HASDOLLAR;executed 289326 times by 1 test: the_word->flags |= 0x000001; | 289326 |
| 5258 | if (quoted)| TRUE | evaluated 367512 times by 1 test | | FALSE | evaluated 2088388 times by 1 test |
| 367512-2088388 |
| 5259 | the_word->flags |= W_QUOTED; executed 367512 times by 1 test: the_word->flags |= 0x000002; | 367512 |
| 5260 | if (compound_assignment && token[token_index-1] == ')')| TRUE | evaluated 708 times by 1 test | | FALSE | evaluated 2455192 times by 1 test |
| TRUE | evaluated 706 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-2455192 |
| 5261 | the_word->flags |= W_COMPASSIGN;executed 706 times by 1 test: the_word->flags |= 0x008000; | 706 |
| 5262 | | - |
| 5263 | | - |
| 5264 | | - |
| 5265 | if (assignment (token, (parser_state & PST_COMPASSIGN) != 0))| TRUE | evaluated 127764 times by 1 test | | FALSE | evaluated 2328136 times by 1 test |
| 127764-2328136 |
| 5266 | { | - |
| 5267 | the_word->flags |= W_ASSIGNMENT; | - |
| 5268 | | - |
| 5269 | if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0)| TRUE | evaluated 9187 times by 1 test | | FALSE | evaluated 118577 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 118574 times by 1 test |
| TRUE | evaluated 3 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
| TRUE | evaluated 118574 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 118574 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 118574 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 105986 times by 1 test | | FALSE | evaluated 12588 times by 1 test |
| TRUE | evaluated 115176 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 4171 times by 1 test | | FALSE | evaluated 8417 times by 1 test |
| 0-118577 |
| 5270 | { | - |
| 5271 | the_word->flags |= W_NOSPLIT; | - |
| 5272 | if (parser_state & PST_COMPASSIGN)| TRUE | evaluated 4171 times by 1 test | | FALSE | evaluated 115176 times by 1 test |
| 4171-115176 |
| 5273 | the_word->flags |= W_NOGLOB; executed 4171 times by 1 test: the_word->flags |= 0x000020; | 4171 |
| 5274 | }executed 119347 times by 1 test: end of block | 119347 |
| 5275 | }executed 127764 times by 1 test: end of block | 127764 |
| 5276 | | - |
| 5277 | if (command_token_position (last_read_token))| TRUE | evaluated 11944 times by 1 test | | FALSE | evaluated 2443956 times by 1 test |
| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 2443948 times by 1 test |
| TRUE | evaluated 8 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
| TRUE | evaluated 2443941 times by 1 test | | FALSE | evaluated 7 times by 1 test |
| TRUE | evaluated 2443941 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2443941 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1214275 times by 1 test | | FALSE | evaluated 1229666 times by 1 test |
| 0-2443956 |
| 5278 | { | - |
| 5279 | struct builtin *b; | - |
| 5280 | b = builtin_address_internal (token, 0); | - |
| 5281 | if (b && (b->flags & ASSIGNMENT_BUILTIN))| TRUE | evaluated 869478 times by 1 test | | FALSE | evaluated 356749 times by 1 test |
| TRUE | evaluated 4882 times by 1 test | | FALSE | evaluated 864596 times by 1 test |
| 4882-869478 |
| 5282 | parser_state |= PST_ASSIGNOK;executed 4882 times by 1 test: parser_state |= 0x004000; | 4882 |
| 5283 | else if (STREQ (token, "eval") || STREQ (token, "let")) never executed: __result = (((const unsigned char *) (const char *) ( token ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "eval" ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( token ))[3] - __s2[3]); never executed: end of block never executed: end of block executed 2786 times by 1 test: __result = (((const unsigned char *) (const char *) ( "let" ))[3] - __s2[3]); executed 2791 times by 1 test: end of block executed 7674 times by 1 test: end of block | TRUE | evaluated 757042 times by 1 test | | FALSE | evaluated 464303 times by 1 test |
| TRUE | evaluated 6235 times by 1 test | | FALSE | evaluated 750807 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 7674 times by 1 test | | FALSE | evaluated 1207436 times by 1 test |
| TRUE | evaluated 2786 times by 1 test | | FALSE | evaluated 4888 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 7674 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 7674 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 7674 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2791 times by 1 test | | FALSE | evaluated 4883 times by 1 test |
| TRUE | evaluated 2791 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 2786 times by 1 test | | FALSE | evaluated 5 times by 1 test |
| 0-1207436 |
| 5284 | parser_state |= PST_ASSIGNOK;executed 9021 times by 1 test: parser_state |= 0x004000; | 9021 |
| 5285 | }executed 1226227 times by 1 test: end of block | 1226227 |
| 5286 | | - |
| 5287 | yylval.word = the_word; | - |
| 5288 | | - |
| 5289 | if (token[0] == '{' && token[token_index-1] == '}' &&| TRUE | evaluated 133 times by 1 test | | FALSE | evaluated 2455767 times by 1 test |
| TRUE | evaluated 120 times by 1 test | | FALSE | evaluated 13 times by 1 test |
| 13-2455767 |
| 5290 | (character == '<' || character == '>'))| TRUE | evaluated 29 times by 1 test | | FALSE | evaluated 91 times by 1 test |
| TRUE | evaluated 16 times by 1 test | | FALSE | evaluated 75 times by 1 test |
| 16-91 |
| 5291 | { | - |
| 5292 | | - |
| 5293 | token[token_index-1] = '\0'; | - |
| 5294 | #if defined (ARRAY_VARS) | - |
| 5295 | if (legal_identifier (token+1) || valid_array_reference (token+1, 0))| TRUE | evaluated 43 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-43 |
| 5296 | #else | - |
| 5297 | if (legal_identifier (token+1)) | - |
| 5298 | #endif | - |
| 5299 | { | - |
| 5300 | strcpy (the_word->word, token+1); | - |
| 5301 | | - |
| 5302 | return (REDIR_WORD);executed 45 times by 1 test: return (283); | 45 |
| 5303 | } | - |
| 5304 | else | - |
| 5305 | | - |
| 5306 | | - |
| 5307 | | - |
| 5308 | yylval.word = the_word; never executed: yylval.word = the_word; | 0 |
| 5309 | } | - |
| 5310 | | - |
| 5311 | result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT))| TRUE | evaluated 119347 times by 1 test | | FALSE | evaluated 2336508 times by 1 test |
| 119347-2336508 |
| 5312 | ? ASSIGNMENT_WORD : WORD; | - |
| 5313 | | - |
| 5314 | switch (last_read_token) | - |
| 5315 | { | - |
| 5316 | case FUNCTION:executed 29 times by 1 test: case 271: | 29 |
| 5317 | parser_state |= PST_ALLOWOPNBRC; | - |
| 5318 | function_dstart = line_number; | - |
| 5319 | break;executed 29 times by 1 test: break; | 29 |
| 5320 | case CASE:executed 78112 times by 1 test: case 263: | 78112 |
| 5321 | case SELECT:executed 9 times by 1 test: case 266: | 9 |
| 5322 | case FOR:executed 25658 times by 1 test: case 265: | 25658 |
| 5323 | if (word_top < MAX_CASE_NEST)| TRUE | evaluated 103708 times by 1 test | | FALSE | evaluated 71 times by 1 test |
| 71-103708 |
| 5324 | word_top++;executed 103708 times by 1 test: word_top++; | 103708 |
| 5325 | word_lineno[word_top] = line_number; | - |
| 5326 | expecting_in_token++; | - |
| 5327 | break;executed 103779 times by 1 test: break; | 103779 |
| 5328 | } | - |
| 5329 | | - |
| 5330 | return (result);executed 2455855 times by 1 test: return (result); | 2455855 |
| 5331 | } | - |
| 5332 | | - |
| 5333 | | - |
| 5334 | | - |
| 5335 | static int | - |
| 5336 | reserved_word_acceptable (toksym) | - |
| 5337 | int toksym; | - |
| 5338 | { | - |
| 5339 | switch (toksym) | - |
| 5340 | { | - |
| 5341 | case '\n':executed 2550517 times by 1 test: case '\n': | 2550517 |
| 5342 | case ';':executed 114724 times by 1 test: case ';': | 114724 |
| 5343 | case '(':executed 18447 times by 1 test: case '(': | 18447 |
| 5344 | case ')':executed 342776 times by 1 test: case ')': | 342776 |
| 5345 | case '|':executed 34089 times by 1 test: case '|': | 34089 |
| 5346 | case '&':executed 250 times by 1 test: case '&': | 250 |
| 5347 | case '{':executed 12700 times by 1 test: case '{': | 12700 |
| 5348 | case '}': never executed: case '}': | 0 |
| 5349 | case AND_AND:executed 1762 times by 1 test: case 288: | 1762 |
| 5350 | case BANG:executed 463 times by 1 test: case 277: | 463 |
| 5351 | case BAR_AND:executed 6 times by 1 test: case 303: | 6 |
| 5352 | case DO:executed 14759 times by 1 test: case 269: | 14759 |
| 5353 | case DONE:executed 26 times by 1 test: case 270: | 26 |
| 5354 | case ELIF:executed 229 times by 1 test: case 261: | 229 |
| 5355 | case ELSE:executed 72 times by 1 test: case 260: | 72 |
| 5356 | case ESAC:executed 4 times by 1 test: case 264: | 4 |
| 5357 | case FI: never executed: case 262: | 0 |
| 5358 | case IF:executed 2481 times by 1 test: case 258: | 2481 |
| 5359 | case OR_OR:executed 44405 times by 1 test: case 289: | 44405 |
| 5360 | case SEMI_SEMI:executed 114 times by 1 test: case 295: | 114 |
| 5361 | case SEMI_AND: never executed: case 296: | 0 |
| 5362 | case SEMI_SEMI_AND: never executed: case 297: | 0 |
| 5363 | case THEN:executed 151 times by 1 test: case 259: | 151 |
| 5364 | case TIME:executed 14 times by 1 test: case 278: | 14 |
| 5365 | case TIMEOPT:executed 18 times by 1 test: case 279: | 18 |
| 5366 | case TIMEIGN:executed 2 times by 1 test: case 280: | 2 |
| 5367 | case COPROC:executed 70 times by 1 test: case 272: | 70 |
| 5368 | case UNTIL:executed 29 times by 1 test: case 268: | 29 |
| 5369 | case WHILE:executed 15370 times by 1 test: case 267: | 15370 |
| 5370 | case 0:executed 2547 times by 1 test: case 0: | 2547 |
| 5371 | return 1;executed 3156025 times by 1 test: return 1; | 3156025 |
| 5372 | default:executed 2257863 times by 1 test: default: | 2257863 |
| 5373 | #if defined (COPROCESS_SUPPORT) | - |
| 5374 | if (last_read_token == WORD && token_before_that == COPROC)| TRUE | evaluated 1994064 times by 1 test | | FALSE | evaluated 263799 times by 1 test |
| TRUE | evaluated 35 times by 1 test | | FALSE | evaluated 1994029 times by 1 test |
| 35-1994064 |
| 5375 | return 1;executed 35 times by 1 test: return 1; | 35 |
| 5376 | #endif | - |
| 5377 | if (last_read_token == WORD && token_before_that == FUNCTION)| TRUE | evaluated 1994029 times by 1 test | | FALSE | evaluated 263799 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 1994029 times by 1 test |
| 0-1994029 |
| 5378 | return 1; never executed: return 1; | 0 |
| 5379 | return 0;executed 2257828 times by 1 test: return 0; | 2257828 |
| 5380 | } | - |
| 5381 | } | - |
| 5382 | | - |
| 5383 | | - |
| 5384 | | - |
| 5385 | int | - |
| 5386 | find_reserved_word (tokstr) | - |
| 5387 | char *tokstr; | - |
| 5388 | { | - |
| 5389 | int i; | - |
| 5390 | for (i = 0; word_token_alist[i].word; i++)| TRUE | evaluated 14488 times by 1 test | | FALSE | evaluated 654 times by 1 test |
| 654-14488 |
| 5391 | if (STREQ (tokstr, word_token_alist[i].word)) never executed: __result = (((const unsigned char *) (const char *) ( tokstr ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( word_token_alist[i].word ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | evaluated 1672 times by 1 test | | FALSE | evaluated 12816 times by 1 test |
| TRUE | evaluated 10 times by 1 test | | FALSE | evaluated 1662 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-12816 |
| 5392 | return i;executed 10 times by 1 test: return i; | 10 |
| 5393 | return -1;executed 654 times by 1 test: return -1; | 654 |
| 5394 | } | - |
| 5395 | | - |
| 5396 | | - |
| 5397 | | - |
| 5398 | int | - |
| 5399 | parser_in_command_position () | - |
| 5400 | { | - |
| 5401 | return (command_token_position (last_read_token)); never executed: return ((((last_read_token) == 282) || ((parser_state&0x080000) && (last_read_token == '<' || last_read_token == '>' || last_read_token == 290 || last_read_token == 302 || last_read_token == 301 || last_read_token == 298 || last_read_token == 291 || last_read_token == 293 || last_read_token == 292 || last_read_token == 294 || last_read_token == 299) == 0) || ((last_read_token) != 295 && (last_read_token) != 296 && (last_read_token) != 297 && reserved_word_acceptable(last_read_token)))); | 0 |
| 5402 | } | - |
| 5403 | | - |
| 5404 | #if 0 | - |
| 5405 | #if defined (READLINE) | - |
| 5406 | | - |
| 5407 | | - |
| 5408 | | - |
| 5409 | static void | - |
| 5410 | reset_readline_prompt () | - |
| 5411 | { | - |
| 5412 | char *temp_prompt; | - |
| 5413 | | - |
| 5414 | if (prompt_string_pointer) | - |
| 5415 | { | - |
| 5416 | temp_prompt = (*prompt_string_pointer) | - |
| 5417 | ? decode_prompt_string (*prompt_string_pointer) | - |
| 5418 | : (char *)NULL; | - |
| 5419 | | - |
| 5420 | if (temp_prompt == 0) | - |
| 5421 | { | - |
| 5422 | temp_prompt = (char *)xmalloc (1); | - |
| 5423 | temp_prompt[0] = '\0'; | - |
| 5424 | } | - |
| 5425 | | - |
| 5426 | FREE (current_readline_prompt); | - |
| 5427 | current_readline_prompt = temp_prompt; | - |
| 5428 | } | - |
| 5429 | } | - |
| 5430 | #endif /* READLINE */ | - |
| 5431 | #endif /* 0 */ | - |
| 5432 | | - |
| 5433 | #if defined (HISTORY) | - |
| 5434 | | - |
| 5435 | | - |
| 5436 | | - |
| 5437 | static const int no_semi_successors[] = { | - |
| 5438 | '\n', '{', '(', ')', ';', '&', '|', | - |
| 5439 | CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, | - |
| 5440 | WHILE, AND_AND, OR_OR, IN, | - |
| 5441 | 0 | - |
| 5442 | }; | - |
| 5443 | | - |
| 5444 | | - |
| 5445 | | - |
| 5446 | | - |
| 5447 | | - |
| 5448 | | - |
| 5449 | char * | - |
| 5450 | history_delimiting_chars (line) | - |
| 5451 | const char *line; | - |
| 5452 | { | - |
| 5453 | static int last_was_heredoc = 0; | - |
| 5454 | register int i; | - |
| 5455 | | - |
| 5456 | if ((parser_state & PST_HEREDOC) == 0)| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 4-5 |
| 5457 | last_was_heredoc = 0;executed 5 times by 1 test: last_was_heredoc = 0; | 5 |
| 5458 | | - |
| 5459 | if (dstack.delimiter_depth != 0)| TRUE | never evaluated | | FALSE | evaluated 9 times by 1 test |
| 0-9 |
| 5460 | return ("\n"); never executed: return ("\n"); | 0 |
| 5461 | | - |
| 5462 | | - |
| 5463 | | - |
| 5464 | | - |
| 5465 | | - |
| 5466 | | - |
| 5467 | if (parser_state & PST_HEREDOC)| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 5 times by 1 test |
| 4-5 |
| 5468 | { | - |
| 5469 | if (last_was_heredoc)| TRUE | never evaluated | | FALSE | evaluated 4 times by 1 test |
| 0-4 |
| 5470 | { | - |
| 5471 | last_was_heredoc = 0; | - |
| 5472 | return "\n"; never executed: return "\n"; | 0 |
| 5473 | } | - |
| 5474 | return (here_doc_first_line ? "\n" : "");executed 4 times by 1 test: return (here_doc_first_line ? "\n" : ""); | 4 |
| 5475 | } | - |
| 5476 | | - |
| 5477 | if (parser_state & PST_COMPASSIGN)| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 5478 | return (" "); never executed: return (" "); | 0 |
| 5479 | | - |
| 5480 | | - |
| 5481 | | - |
| 5482 | | - |
| 5483 | | - |
| 5484 | | - |
| 5485 | | - |
| 5486 | | - |
| 5487 | if (token_before_that == ')')| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 5488 | { | - |
| 5489 | if (two_tokens_ago == '(') | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5490 | return " "; never executed: return " "; | 0 |
| 5491 | | - |
| 5492 | | - |
| 5493 | else if (parser_state & PST_CASESTMT) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5494 | return " "; never executed: return " "; | 0 |
| 5495 | else | - |
| 5496 | return "; "; never executed: return "; "; | 0 |
| 5497 | } | - |
| 5498 | else if (token_before_that == WORD && two_tokens_ago == FUNCTION)| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-3 |
| 5499 | return " "; never executed: return " "; | 0 |
| 5500 | | - |
| 5501 | | - |
| 5502 | | - |
| 5503 | | - |
| 5504 | else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<"))| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 5505 | { | - |
| 5506 | last_was_heredoc = 1; | - |
| 5507 | return "\n"; never executed: return "\n"; | 0 |
| 5508 | } | - |
| 5509 | else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && need_here_doc > 0)| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 5510 | return "\n"; never executed: return "\n"; | 0 |
| 5511 | else if (token_before_that == WORD && two_tokens_ago == FOR)| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 3 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-3 |
| 5512 | { | - |
| 5513 | | - |
| 5514 | | - |
| 5515 | for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5516 | ; never executed: ; | 0 |
| 5517 | if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n')| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5518 | return " "; never executed: return " "; | 0 |
| 5519 | return ";"; never executed: return ";"; | 0 |
| 5520 | } | - |
| 5521 | else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT))| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-5 |
| 5522 | return " "; never executed: return " "; | 0 |
| 5523 | | - |
| 5524 | for (i = 0; no_semi_successors[i]; i++)| TRUE | evaluated 81 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-81 |
| 5525 | { | - |
| 5526 | if (token_before_that == no_semi_successors[i])| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 78 times by 1 test |
| 3-78 |
| 5527 | return (" ");executed 3 times by 1 test: return (" "); | 3 |
| 5528 | }executed 78 times by 1 test: end of block | 78 |
| 5529 | | - |
| 5530 | if (line_isblank (line))| TRUE | never evaluated | | FALSE | evaluated 2 times by 1 test |
| 0-2 |
| 5531 | return (""); never executed: return (""); | 0 |
| 5532 | | - |
| 5533 | return ("; ");executed 2 times by 1 test: return ("; "); | 2 |
| 5534 | } | - |
| 5535 | #endif /* HISTORY */ | - |
| 5536 | | - |
| 5537 | | - |
| 5538 | | - |
| 5539 | static void | - |
| 5540 | prompt_again () | - |
| 5541 | { | - |
| 5542 | char *temp_prompt; | - |
| 5543 | | - |
| 5544 | if (interactive == 0 || expanding_alias ()) | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5545 | return; never executed: return; | 0 |
| 5546 | | - |
| 5547 | ps1_prompt = get_string_value ("PS1"); | - |
| 5548 | ps2_prompt = get_string_value ("PS2"); | - |
| 5549 | | - |
| 5550 | ps0_prompt = get_string_value ("PS0"); | - |
| 5551 | | - |
| 5552 | if (!prompt_string_pointer)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5553 | prompt_string_pointer = &ps1_prompt; never executed: prompt_string_pointer = &ps1_prompt; | 0 |
| 5554 | | - |
| 5555 | temp_prompt = *prompt_string_pointer| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5556 | ? decode_prompt_string (*prompt_string_pointer) | - |
| 5557 | : (char *)NULL; | - |
| 5558 | | - |
| 5559 | if (temp_prompt == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5560 | { | - |
| 5561 | temp_prompt = (char *)xmalloc (1); | - |
| 5562 | temp_prompt[0] = '\0'; | - |
| 5563 | } never executed: end of block | 0 |
| 5564 | | - |
| 5565 | current_prompt_string = *prompt_string_pointer; | - |
| 5566 | prompt_string_pointer = &ps2_prompt; | - |
| 5567 | | - |
| 5568 | #if defined (READLINE) | - |
| 5569 | if (!no_line_editing)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5570 | { | - |
| 5571 | FREE (current_readline_prompt); never executed: sh_xfree((current_readline_prompt), "./parse.y", 5571); | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5572 | current_readline_prompt = temp_prompt; | - |
| 5573 | } never executed: end of block | 0 |
| 5574 | else | - |
| 5575 | #endif /* READLINE */ | - |
| 5576 | { | - |
| 5577 | FREE (current_decoded_prompt); never executed: sh_xfree((current_decoded_prompt), "./parse.y", 5577); | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5578 | current_decoded_prompt = temp_prompt; | - |
| 5579 | } never executed: end of block | 0 |
| 5580 | } | - |
| 5581 | | - |
| 5582 | int | - |
| 5583 | get_current_prompt_level () | - |
| 5584 | { | - |
| 5585 | return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1);executed 17 times by 1 test: return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); | 17 |
| 5586 | } | - |
| 5587 | | - |
| 5588 | void | - |
| 5589 | set_current_prompt_level (x) | - |
| 5590 | int x; | - |
| 5591 | { | - |
| 5592 | prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt;| TRUE | never evaluated | | FALSE | evaluated 176420 times by 1 test |
| 0-176420 |
| 5593 | current_prompt_string = *prompt_string_pointer; | - |
| 5594 | }executed 176420 times by 1 test: end of block | 176420 |
| 5595 | | - |
| 5596 | static void | - |
| 5597 | print_prompt () | - |
| 5598 | { | - |
| 5599 | fprintf (stderr, "%s", current_decoded_prompt); | - |
| 5600 | fflush (stderr); | - |
| 5601 | } never executed: end of block | 0 |
| 5602 | | - |
| 5603 | #if defined (HISTORY) | - |
| 5604 | | - |
| 5605 | | - |
| 5606 | | - |
| 5607 | static int | - |
| 5608 | prompt_history_number (pmt) | - |
| 5609 | char *pmt; | - |
| 5610 | { | - |
| 5611 | int ret; | - |
| 5612 | | - |
| 5613 | ret = history_number (); | - |
| 5614 | if (ret == 1)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5615 | return ret; never executed: return ret; | 0 |
| 5616 | | - |
| 5617 | if (pmt == ps1_prompt) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5618 | return ret; never executed: return ret; | 0 |
| 5619 | else if (pmt == ps2_prompt && command_oriented_history == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5620 | return ret; never executed: return ret; | 0 |
| 5621 | else if (pmt == ps2_prompt && command_oriented_history && current_command_first_line_saved)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5622 | return ret - 1; never executed: return ret - 1; | 0 |
| 5623 | else | - |
| 5624 | return ret - 1; never executed: return ret - 1; | 0 |
| 5625 | } | - |
| 5626 | #endif | - |
| 5627 | | - |
| 5628 | | - |
| 5629 | | - |
| 5630 | | - |
| 5631 | | - |
| 5632 | | - |
| 5633 | | - |
| 5634 | | - |
| 5635 | | - |
| 5636 | | - |
| 5637 | | - |
| 5638 | | - |
| 5639 | | - |
| 5640 | | - |
| 5641 | | - |
| 5642 | | - |
| 5643 | | - |
| 5644 | | - |
| 5645 | | - |
| 5646 | | - |
| 5647 | | - |
| 5648 | | - |
| 5649 | | - |
| 5650 | | - |
| 5651 | | - |
| 5652 | | - |
| 5653 | | - |
| 5654 | | - |
| 5655 | | - |
| 5656 | | - |
| 5657 | | - |
| 5658 | | - |
| 5659 | #define PROMPT_GROWTH 48 | - |
| 5660 | char * | - |
| 5661 | decode_prompt_string (string) | - |
| 5662 | char *string; | - |
| 5663 | { | - |
| 5664 | WORD_LIST *list; | - |
| 5665 | char *result, *t, *orig_string; | - |
| 5666 | struct dstack save_dstack; | - |
| 5667 | int last_exit_value, last_comsub_pid; | - |
| 5668 | #if defined (PROMPT_STRING_DECODE) | - |
| 5669 | size_t result_size; | - |
| 5670 | int result_index; | - |
| 5671 | int c, n, i; | - |
| 5672 | char *temp, *t_host, octal_string[4]; | - |
| 5673 | struct tm *tm; | - |
| 5674 | time_t the_time; | - |
| 5675 | char timebuf[128]; | - |
| 5676 | char *timefmt; | - |
| 5677 | | - |
| 5678 | result = (char *)xmalloc (result_size = PROMPT_GROWTH); | - |
| 5679 | result[result_index = 0] = 0; | - |
| 5680 | temp = (char *)NULL; | - |
| 5681 | orig_string = string; | - |
| 5682 | | - |
| 5683 | while (c = *string++)| TRUE | evaluated 241 times by 1 test | | FALSE | evaluated 61 times by 1 test |
| 61-241 |
| 5684 | { | - |
| 5685 | if (posixly_correct && c == '!')| TRUE | never evaluated | | FALSE | evaluated 241 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-241 |
| 5686 | { | - |
| 5687 | if (*string == '!')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5688 | { | - |
| 5689 | temp = savestring ("!"); | - |
| 5690 | goto add_string; never executed: goto add_string; | 0 |
| 5691 | } | - |
| 5692 | else | - |
| 5693 | { | - |
| 5694 | #if !defined (HISTORY) | - |
| 5695 | temp = savestring ("1"); | - |
| 5696 | #else /* HISTORY */ | - |
| 5697 | temp = itos (prompt_history_number (orig_string)); | - |
| 5698 | #endif /* HISTORY */ | - |
| 5699 | string--; | - |
| 5700 | goto add_string; never executed: goto add_string; | 0 |
| 5701 | } | - |
| 5702 | } | - |
| 5703 | if (c == '\\')| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 237 times by 1 test |
| 4-237 |
| 5704 | { | - |
| 5705 | c = *string; | - |
| 5706 | | - |
| 5707 | switch (c) | - |
| 5708 | { | - |
| 5709 | case '0': never executed: case '0': | 0 |
| 5710 | case '1': never executed: case '1': | 0 |
| 5711 | case '2': never executed: case '2': | 0 |
| 5712 | case '3': never executed: case '3': | 0 |
| 5713 | case '4': never executed: case '4': | 0 |
| 5714 | case '5': never executed: case '5': | 0 |
| 5715 | case '6': never executed: case '6': | 0 |
| 5716 | case '7': never executed: case '7': | 0 |
| 5717 | strncpy (octal_string, string, 3); | - |
| 5718 | octal_string[3] = '\0'; | - |
| 5719 | | - |
| 5720 | n = read_octal (octal_string); | - |
| 5721 | temp = (char *)xmalloc (3); | - |
| 5722 | | - |
| 5723 | if (n == CTLESC || n == CTLNUL)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5724 | { | - |
| 5725 | temp[0] = CTLESC; | - |
| 5726 | temp[1] = n; | - |
| 5727 | temp[2] = '\0'; | - |
| 5728 | } never executed: end of block | 0 |
| 5729 | else if (n == -1)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5730 | { | - |
| 5731 | temp[0] = '\\'; | - |
| 5732 | temp[1] = '\0'; | - |
| 5733 | } never executed: end of block | 0 |
| 5734 | else | - |
| 5735 | { | - |
| 5736 | temp[0] = n; | - |
| 5737 | temp[1] = '\0'; | - |
| 5738 | } never executed: end of block | 0 |
| 5739 | | - |
| 5740 | for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5741 | string++; never executed: string++; | 0 |
| 5742 | | - |
| 5743 | c = 0; | - |
| 5744 | goto add_string; never executed: goto add_string; | 0 |
| 5745 | | - |
| 5746 | case 'd': never executed: case 'd': | 0 |
| 5747 | case 't': never executed: case 't': | 0 |
| 5748 | case 'T': never executed: case 'T': | 0 |
| 5749 | case '@': never executed: case '@': | 0 |
| 5750 | case 'A': never executed: case 'A': | 0 |
| 5751 | | - |
| 5752 | (void) time (&the_time); | - |
| 5753 | #if defined (HAVE_TZSET) | - |
| 5754 | sv_tz ("TZ"); | - |
| 5755 | #endif | - |
| 5756 | tm = localtime (&the_time); | - |
| 5757 | | - |
| 5758 | if (c == 'd')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5759 | n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); never executed: n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); | 0 |
| 5760 | else if (c == 't')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5761 | n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); never executed: n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); | 0 |
| 5762 | else if (c == 'T')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5763 | n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); never executed: n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); | 0 |
| 5764 | else if (c == '@')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5765 | n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); never executed: n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); | 0 |
| 5766 | else if (c == 'A')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5767 | n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); never executed: n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); | 0 |
| 5768 | | - |
| 5769 | if (n == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5770 | timebuf[0] = '\0'; never executed: timebuf[0] = '\0'; | 0 |
| 5771 | else | - |
| 5772 | timebuf[sizeof(timebuf) - 1] = '\0'; never executed: timebuf[sizeof(timebuf) - 1] = '\0'; | 0 |
| 5773 | | - |
| 5774 | temp = savestring (timebuf); | - |
| 5775 | goto add_string; never executed: goto add_string; | 0 |
| 5776 | | - |
| 5777 | case 'D': never executed: case 'D': | 0 |
| 5778 | if (string[1] != '{') | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5779 | goto not_escape; never executed: goto not_escape; | 0 |
| 5780 | | - |
| 5781 | (void) time (&the_time); | - |
| 5782 | tm = localtime (&the_time); | - |
| 5783 | string += 2; | - |
| 5784 | timefmt = xmalloc (strlen (string) + 3); | - |
| 5785 | for (t = timefmt; *string && *string != '}'; )| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5786 | *t++ = *string++; never executed: *t++ = *string++; | 0 |
| 5787 | *t = '\0'; | - |
| 5788 | c = *string; | - |
| 5789 | if (timefmt[0] == '\0')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5790 | { | - |
| 5791 | timefmt[0] = '%'; | - |
| 5792 | timefmt[1] = 'X'; | - |
| 5793 | timefmt[2] = '\0'; | - |
| 5794 | } never executed: end of block | 0 |
| 5795 | n = strftime (timebuf, sizeof (timebuf), timefmt, tm); | - |
| 5796 | free (timefmt); | - |
| 5797 | | - |
| 5798 | if (n == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5799 | timebuf[0] = '\0'; never executed: timebuf[0] = '\0'; | 0 |
| 5800 | else | - |
| 5801 | timebuf[sizeof(timebuf) - 1] = '\0'; never executed: timebuf[sizeof(timebuf) - 1] = '\0'; | 0 |
| 5802 | | - |
| 5803 | if (promptvars || posixly_correct)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5804 | | - |
| 5805 | | - |
| 5806 | | - |
| 5807 | temp = sh_backslash_quote_for_double_quotes (timebuf); never executed: temp = sh_backslash_quote_for_double_quotes (timebuf); | 0 |
| 5808 | else | - |
| 5809 | temp = savestring (timebuf); never executed: temp = (char *)strcpy (sh_xmalloc((1 + strlen (timebuf)), "./parse.y", 5809), (timebuf)); | 0 |
| 5810 | goto add_string; never executed: goto add_string; | 0 |
| 5811 | | - |
| 5812 | case 'n': never executed: case 'n': | 0 |
| 5813 | temp = (char *)xmalloc (3); | - |
| 5814 | temp[0] = no_line_editing ? '\n' : '\r';| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5815 | temp[1] = no_line_editing ? '\0' : '\n';| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5816 | temp[2] = '\0'; | - |
| 5817 | goto add_string; never executed: goto add_string; | 0 |
| 5818 | | - |
| 5819 | case 's': never executed: case 's': | 0 |
| 5820 | temp = base_pathname (shell_name); | - |
| 5821 | | - |
| 5822 | if (promptvars || posixly_correct)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5823 | temp = sh_backslash_quote_for_double_quotes (temp); never executed: temp = sh_backslash_quote_for_double_quotes (temp); | 0 |
| 5824 | else | - |
| 5825 | temp = savestring (temp); never executed: temp = (char *)strcpy (sh_xmalloc((1 + strlen (temp)), "./parse.y", 5825), (temp)); | 0 |
| 5826 | goto add_string; never executed: goto add_string; | 0 |
| 5827 | | - |
| 5828 | case 'v':executed 1 time by 1 test: case 'v': | 1 |
| 5829 | case 'V': never executed: case 'V': | 0 |
| 5830 | temp = (char *)xmalloc (16); | - |
| 5831 | if (c == 'v')| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 5832 | strcpy (temp, dist_version);executed 1 time by 1 test: strcpy (temp, dist_version); | 1 |
| 5833 | else | - |
| 5834 | sprintf (temp, "%s.%d", dist_version, patch_level); never executed: sprintf (temp, "%s.%d", dist_version, patch_level); | 0 |
| 5835 | goto add_string;executed 1 time by 1 test: goto add_string; | 1 |
| 5836 | | - |
| 5837 | case 'w': never executed: case 'w': | 0 |
| 5838 | case 'W': never executed: case 'W': | 0 |
| 5839 | { | - |
| 5840 | | - |
| 5841 | char t_string[PATH_MAX]; | - |
| 5842 | int tlen; | - |
| 5843 | | - |
| 5844 | temp = get_string_value ("PWD"); | - |
| 5845 | | - |
| 5846 | if (temp == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5847 | { | - |
| 5848 | if (getcwd (t_string, sizeof(t_string)) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5849 | { | - |
| 5850 | t_string[0] = '.'; | - |
| 5851 | tlen = 1; | - |
| 5852 | } never executed: end of block | 0 |
| 5853 | else | - |
| 5854 | tlen = strlen (t_string); never executed: tlen = strlen (t_string); | 0 |
| 5855 | } | - |
| 5856 | else | - |
| 5857 | { | - |
| 5858 | tlen = sizeof (t_string) - 1; | - |
| 5859 | strncpy (t_string, temp, tlen); | - |
| 5860 | } never executed: end of block | 0 |
| 5861 | t_string[tlen] = '\0'; | - |
| 5862 | | - |
| 5863 | #if defined (MACOSX) | - |
| 5864 | | - |
| 5865 | temp = fnx_fromfs (t_string, strlen (t_string)); | - |
| 5866 | if (temp != t_string) | - |
| 5867 | strcpy (t_string, temp); | - |
| 5868 | #endif | - |
| 5869 | | - |
| 5870 | #define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) | - |
| 5871 | #define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) | - |
| 5872 | | - |
| 5873 | if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) never executed: __result = (((const unsigned char *) (const char *) ( t ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( t_string ))[3] - __s2[3]); never executed: end of block never executed: end of block | TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5874 | { | - |
| 5875 | if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5876 | { | - |
| 5877 | t = strrchr (t_string, '/'); | - |
| 5878 | if (t)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5879 | memmove (t_string, t + 1, strlen (t)); never executed: memmove (t_string, t + 1, strlen (t)); | 0 |
| 5880 | } never executed: end of block | 0 |
| 5881 | } never executed: end of block | 0 |
| 5882 | #undef ROOT_PATH | - |
| 5883 | #undef DOUBLE_SLASH_ROOT | - |
| 5884 | else | - |
| 5885 | { | - |
| 5886 | | - |
| 5887 | | - |
| 5888 | temp = polite_directory_format (t_string); | - |
| 5889 | if (temp != t_string)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5890 | strcpy (t_string, temp); never executed: strcpy (t_string, temp); | 0 |
| 5891 | } never executed: end of block | 0 |
| 5892 | | - |
| 5893 | temp = trim_pathname (t_string, PATH_MAX - 1); | - |
| 5894 | | - |
| 5895 | | - |
| 5896 | if (promptvars || posixly_correct)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5897 | | - |
| 5898 | | - |
| 5899 | | - |
| 5900 | temp = sh_backslash_quote_for_double_quotes (t_string); never executed: temp = sh_backslash_quote_for_double_quotes (t_string); | 0 |
| 5901 | else | - |
| 5902 | temp = savestring (t_string); never executed: temp = (char *)strcpy (sh_xmalloc((1 + strlen (t_string)), "./parse.y", 5902), (t_string)); | 0 |
| 5903 | | - |
| 5904 | goto add_string; never executed: goto add_string; | 0 |
| 5905 | } | - |
| 5906 | | - |
| 5907 | case 'u': never executed: case 'u': | 0 |
| 5908 | if (current_user.user_name == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5909 | get_current_user_info (); never executed: get_current_user_info (); | 0 |
| 5910 | temp = savestring (current_user.user_name); | - |
| 5911 | goto add_string; never executed: goto add_string; | 0 |
| 5912 | | - |
| 5913 | case 'h': never executed: case 'h': | 0 |
| 5914 | case 'H': never executed: case 'H': | 0 |
| 5915 | t_host = savestring (current_host_name); | - |
| 5916 | if (c == 'h' && (t = (char *)strchr (t_host, '.')))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5917 | *t = '\0'; never executed: *t = '\0'; | 0 |
| 5918 | if (promptvars || posixly_correct)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5919 | | - |
| 5920 | | - |
| 5921 | | - |
| 5922 | temp = sh_backslash_quote_for_double_quotes (t_host); never executed: temp = sh_backslash_quote_for_double_quotes (t_host); | 0 |
| 5923 | else | - |
| 5924 | temp = savestring (t_host); never executed: temp = (char *)strcpy (sh_xmalloc((1 + strlen (t_host)), "./parse.y", 5924), (t_host)); | 0 |
| 5925 | free (t_host); | - |
| 5926 | goto add_string; never executed: goto add_string; | 0 |
| 5927 | | - |
| 5928 | case '#': never executed: case '#': | 0 |
| 5929 | n = current_command_number; | - |
| 5930 | | - |
| 5931 | | - |
| 5932 | if (orig_string != ps0_prompt && orig_string != ps1_prompt && orig_string != ps2_prompt)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5933 | n--; never executed: n--; | 0 |
| 5934 | temp = itos (n); | - |
| 5935 | goto add_string; never executed: goto add_string; | 0 |
| 5936 | | - |
| 5937 | case '!': never executed: case '!': | 0 |
| 5938 | #if !defined (HISTORY) | - |
| 5939 | temp = savestring ("1"); | - |
| 5940 | #else /* HISTORY */ | - |
| 5941 | temp = itos (prompt_history_number (orig_string)); | - |
| 5942 | #endif /* HISTORY */ | - |
| 5943 | goto add_string; never executed: goto add_string; | 0 |
| 5944 | | - |
| 5945 | case '$':executed 1 time by 1 test: case '$': | 1 |
| 5946 | t = temp = (char *)xmalloc (3); | - |
| 5947 | if ((promptvars || posixly_correct) && (current_user.euid != 0))| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 5948 | *t++ = '\\';executed 1 time by 1 test: *t++ = '\\'; | 1 |
| 5949 | *t++ = current_user.euid == 0 ? '#' : '$';| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
| 0-1 |
| 5950 | *t = '\0'; | - |
| 5951 | goto add_string;executed 1 time by 1 test: goto add_string; | 1 |
| 5952 | | - |
| 5953 | case 'j': never executed: case 'j': | 0 |
| 5954 | temp = itos (count_all_jobs ()); | - |
| 5955 | goto add_string; never executed: goto add_string; | 0 |
| 5956 | | - |
| 5957 | case 'l': never executed: case 'l': | 0 |
| 5958 | #if defined (HAVE_TTYNAME) | - |
| 5959 | temp = (char *)ttyname (fileno (stdin)); | - |
| 5960 | t = temp ? base_pathname (temp) : "tty";| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5961 | temp = savestring (t); | - |
| 5962 | #else | - |
| 5963 | temp = savestring ("tty"); | - |
| 5964 | #endif /* !HAVE_TTYNAME */ | - |
| 5965 | goto add_string; never executed: goto add_string; | 0 |
| 5966 | | - |
| 5967 | #if defined (READLINE) | - |
| 5968 | case '[':executed 1 time by 1 test: case '[': | 1 |
| 5969 | case ']':executed 1 time by 1 test: case ']': | 1 |
| 5970 | if (no_line_editing)| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 5971 | { | - |
| 5972 | string++; | - |
| 5973 | break;executed 2 times by 1 test: break; | 2 |
| 5974 | } | - |
| 5975 | temp = (char *)xmalloc (3); | - |
| 5976 | n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE;| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5977 | i = 0; | - |
| 5978 | if (n == CTLESC || n == CTLNUL)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5979 | temp[i++] = CTLESC; never executed: temp[i++] = '\001'; | 0 |
| 5980 | temp[i++] = n; | - |
| 5981 | temp[i] = '\0'; | - |
| 5982 | goto add_string; never executed: goto add_string; | 0 |
| 5983 | #endif /* READLINE */ | - |
| 5984 | | - |
| 5985 | case '\\': never executed: case '\\': | 0 |
| 5986 | case 'a': never executed: case 'a': | 0 |
| 5987 | case 'e': never executed: case 'e': | 0 |
| 5988 | case 'r': never executed: case 'r': | 0 |
| 5989 | temp = (char *)xmalloc (2); | - |
| 5990 | if (c == 'a')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5991 | temp[0] = '\07'; never executed: temp[0] = '\07'; | 0 |
| 5992 | else if (c == 'e')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5993 | temp[0] = '\033'; never executed: temp[0] = '\033'; | 0 |
| 5994 | else if (c == 'r')| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 5995 | temp[0] = '\r'; never executed: temp[0] = '\r'; | 0 |
| 5996 | else | - |
| 5997 | temp[0] = c; never executed: temp[0] = c; | 0 |
| 5998 | temp[1] = '\0'; | - |
| 5999 | goto add_string; never executed: goto add_string; | 0 |
| 6000 | | - |
| 6001 | default: never executed: default: | 0 |
| 6002 | not_escape: | - |
| 6003 | temp = (char *)xmalloc (3); | - |
| 6004 | temp[0] = '\\'; | - |
| 6005 | temp[1] = c; | - |
| 6006 | temp[2] = '\0'; | - |
| 6007 | | - |
| 6008 | add_string: code before this statement never executed: add_string: | 0 |
| 6009 | if (c)| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 6010 | string++;executed 2 times by 1 test: string++; | 2 |
| 6011 | result = | - |
| 6012 | sub_append_string (temp, result, &result_index, &result_size); | - |
| 6013 | temp = (char *)NULL; | - |
| 6014 | result[result_index] = '\0'; | - |
| 6015 | break;executed 2 times by 1 test: break; | 2 |
| 6016 | } | - |
| 6017 | } | - |
| 6018 | else | - |
| 6019 | { | - |
| 6020 | RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); never executed: result_size += (48); never executed: end of block | TRUE | never evaluated | | FALSE | evaluated 237 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-237 |
| 6021 | | - |
| 6022 | | - |
| 6023 | if (c == CTLESC || c == CTLNUL)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 236 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 235 times by 1 test |
| 1-236 |
| 6024 | result[result_index++] = CTLESC;executed 2 times by 1 test: result[result_index++] = '\001'; | 2 |
| 6025 | result[result_index++] = c; | - |
| 6026 | result[result_index] = '\0'; | - |
| 6027 | }executed 237 times by 1 test: end of block | 237 |
| 6028 | } | - |
| 6029 | #else /* !PROMPT_STRING_DECODE */ | - |
| 6030 | result = savestring (string); | - |
| 6031 | #endif /* !PROMPT_STRING_DECODE */ | - |
| 6032 | | - |
| 6033 | | - |
| 6034 | | - |
| 6035 | | - |
| 6036 | save_dstack = dstack; | - |
| 6037 | dstack = temp_dstack; | - |
| 6038 | dstack.delimiter_depth = 0; | - |
| 6039 | | - |
| 6040 | | - |
| 6041 | | - |
| 6042 | if (promptvars || posixly_correct)| TRUE | evaluated 61 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-61 |
| 6043 | { | - |
| 6044 | last_exit_value = last_command_exit_value; | - |
| 6045 | last_comsub_pid = last_command_subst_pid; | - |
| 6046 | list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); | - |
| 6047 | free (result); | - |
| 6048 | result = string_list (list); | - |
| 6049 | dispose_words (list); | - |
| 6050 | last_command_exit_value = last_exit_value; | - |
| 6051 | last_command_subst_pid = last_comsub_pid; | - |
| 6052 | }executed 61 times by 1 test: end of block | 61 |
| 6053 | else | - |
| 6054 | { | - |
| 6055 | t = dequote_string (result); | - |
| 6056 | free (result); | - |
| 6057 | result = t; | - |
| 6058 | } never executed: end of block | 0 |
| 6059 | | - |
| 6060 | dstack = save_dstack; | - |
| 6061 | | - |
| 6062 | return (result);executed 61 times by 1 test: return (result); | 61 |
| 6063 | } | - |
| 6064 | | - |
| 6065 | | - |
| 6066 | | - |
| 6067 | | - |
| 6068 | | - |
| 6069 | | - |
| 6070 | | - |
| 6071 | | - |
| 6072 | | - |
| 6073 | int | - |
| 6074 | yyerror (msg) | - |
| 6075 | const char *msg; | - |
| 6076 | { | - |
| 6077 | report_syntax_error ((char *)NULL); | - |
| 6078 | reset_parser (); | - |
| 6079 | return (0);executed 44 times by 1 test: return (0); | 44 |
| 6080 | } | - |
| 6081 | | - |
| 6082 | static char * | - |
| 6083 | error_token_from_token (tok) | - |
| 6084 | int tok; | - |
| 6085 | { | - |
| 6086 | char *t; | - |
| 6087 | | - |
| 6088 | if (t = find_token_in_alist (tok, word_token_alist, 0))| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 33 times by 1 test |
| 4-33 |
| 6089 | return t;executed 4 times by 1 test: return t; | 4 |
| 6090 | | - |
| 6091 | if (t = find_token_in_alist (tok, other_token_alist, 0))| TRUE | evaluated 26 times by 1 test | | FALSE | evaluated 7 times by 1 test |
| 7-26 |
| 6092 | return t;executed 26 times by 1 test: return t; | 26 |
| 6093 | | - |
| 6094 | t = (char *)NULL; | - |
| 6095 | | - |
| 6096 | switch (current_token) | - |
| 6097 | { | - |
| 6098 | case WORD:executed 7 times by 1 test: case 281: | 7 |
| 6099 | case ASSIGNMENT_WORD: never executed: case 282: | 0 |
| 6100 | if (yylval.word)| TRUE | evaluated 7 times by 1 test | | FALSE | never evaluated |
| 0-7 |
| 6101 | t = savestring (yylval.word->word);executed 7 times by 1 test: t = (char *)strcpy (sh_xmalloc((1 + strlen (yylval.word->word)), "./parse.y", 6101), (yylval.word->word)); | 7 |
| 6102 | break;executed 7 times by 1 test: break; | 7 |
| 6103 | case NUMBER: never executed: case 284: | 0 |
| 6104 | t = itos (yylval.number); | - |
| 6105 | break; never executed: break; | 0 |
| 6106 | case ARITH_CMD: never executed: case 285: | 0 |
| 6107 | if (yylval.word_list)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6108 | t = string_list (yylval.word_list); never executed: t = string_list (yylval.word_list); | 0 |
| 6109 | break; never executed: break; | 0 |
| 6110 | case ARITH_FOR_EXPRS: never executed: case 286: | 0 |
| 6111 | if (yylval.word_list)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6112 | t = string_list_internal (yylval.word_list, " ; "); never executed: t = string_list_internal (yylval.word_list, " ; "); | 0 |
| 6113 | break; never executed: break; | 0 |
| 6114 | case COND_CMD: never executed: case 287: | 0 |
| 6115 | t = (char *)NULL; | - |
| 6116 | break; never executed: break; | 0 |
| 6117 | } | - |
| 6118 | | - |
| 6119 | return t;executed 7 times by 1 test: return t; | 7 |
| 6120 | } | - |
| 6121 | | - |
| 6122 | static char * | - |
| 6123 | error_token_from_text () | - |
| 6124 | { | - |
| 6125 | char *msg, *t; | - |
| 6126 | int token_end, i; | - |
| 6127 | | - |
| 6128 | t = shell_input_line; | - |
| 6129 | i = shell_input_line_index; | - |
| 6130 | token_end = 0; | - |
| 6131 | msg = (char *)NULL; | - |
| 6132 | | - |
| 6133 | if (i && t[i] == '\0')| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6134 | i--; never executed: i--; | 0 |
| 6135 | | - |
| 6136 | while (i && (whitespace (t[i]) || t[i] == '\n'))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6137 | i--; never executed: i--; | 0 |
| 6138 | | - |
| 6139 | if (i)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6140 | token_end = i + 1; never executed: token_end = i + 1; | 0 |
| 6141 | | - |
| 6142 | while (i && (member (t[i], " \n\t;|&") == 0))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6143 | i--; never executed: i--; | 0 |
| 6144 | | - |
| 6145 | while (i != token_end && (whitespace (t[i]) || t[i] == '\n'))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6146 | i++; never executed: i++; | 0 |
| 6147 | | - |
| 6148 | | - |
| 6149 | if (token_end || (i == 0 && token_end == 0))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6150 | { | - |
| 6151 | if (token_end)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6152 | msg = substring (t, i, token_end); never executed: msg = substring (t, i, token_end); | 0 |
| 6153 | else | - |
| 6154 | { | - |
| 6155 | msg = (char *)xmalloc (2); | - |
| 6156 | msg[0] = t[i]; | - |
| 6157 | msg[1] = '\0'; | - |
| 6158 | } never executed: end of block | 0 |
| 6159 | } | - |
| 6160 | | - |
| 6161 | return (msg); never executed: return (msg); | 0 |
| 6162 | } | - |
| 6163 | | - |
| 6164 | static void | - |
| 6165 | print_offending_line () | - |
| 6166 | { | - |
| 6167 | char *msg; | - |
| 6168 | int token_end; | - |
| 6169 | | - |
| 6170 | msg = savestring (shell_input_line); | - |
| 6171 | token_end = strlen (msg); | - |
| 6172 | while (token_end && msg[token_end - 1] == '\n')| TRUE | evaluated 73 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 36 times by 1 test | | FALSE | evaluated 37 times by 1 test |
| 0-73 |
| 6173 | msg[--token_end] = '\0';executed 36 times by 1 test: msg[--token_end] = '\0'; | 36 |
| 6174 | | - |
| 6175 | parser_error (line_number, "`%s'", msg); | - |
| 6176 | free (msg); | - |
| 6177 | }executed 37 times by 1 test: end of block | 37 |
| 6178 | | - |
| 6179 | | - |
| 6180 | | - |
| 6181 | | - |
| 6182 | | - |
| 6183 | static void | - |
| 6184 | report_syntax_error (message) | - |
| 6185 | char *message; | - |
| 6186 | { | - |
| 6187 | char *msg, *p; | - |
| 6188 | | - |
| 6189 | if (message)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 44 times by 1 test |
| 1-44 |
| 6190 | { | - |
| 6191 | parser_error (line_number, "%s", message); | - |
| 6192 | if (interactive && EOF_Reached)| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-1 |
| 6193 | EOF_Reached = 0; never executed: EOF_Reached = 0; | 0 |
| 6194 | last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE;| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
| 0-1 |
| 6195 | return;executed 1 time by 1 test: return; | 1 |
| 6196 | } | - |
| 6197 | | - |
| 6198 | | - |
| 6199 | | - |
| 6200 | | - |
| 6201 | if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token)))| TRUE | evaluated 44 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 37 times by 1 test | | FALSE | evaluated 7 times by 1 test |
| TRUE | evaluated 37 times by 1 test | | FALSE | never evaluated |
| 0-44 |
| 6202 | { | - |
| 6203 | if (ansic_shouldquote (msg))| TRUE | never evaluated | | FALSE | evaluated 37 times by 1 test |
| 0-37 |
| 6204 | { | - |
| 6205 | p = ansic_quote (msg, 0, NULL); | - |
| 6206 | free (msg); | - |
| 6207 | msg = p; | - |
| 6208 | } never executed: end of block | 0 |
| 6209 | parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); | - |
| 6210 | free (msg); | - |
| 6211 | | - |
| 6212 | if (interactive == 0)| TRUE | evaluated 37 times by 1 test | | FALSE | never evaluated |
| 0-37 |
| 6213 | print_offending_line ();executed 37 times by 1 test: print_offending_line (); | 37 |
| 6214 | | - |
| 6215 | last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE;| TRUE | evaluated 11 times by 1 test | | FALSE | evaluated 26 times by 1 test |
| 11-26 |
| 6216 | return;executed 37 times by 1 test: return; | 37 |
| 6217 | } | - |
| 6218 | | - |
| 6219 | | - |
| 6220 | | - |
| 6221 | | - |
| 6222 | if (shell_input_line && *shell_input_line)| TRUE | evaluated 7 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 7 times by 1 test |
| 0-7 |
| 6223 | { | - |
| 6224 | msg = error_token_from_text (); | - |
| 6225 | if (msg)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6226 | { | - |
| 6227 | parser_error (line_number, _("syntax error near `%s'"), msg); | - |
| 6228 | free (msg); | - |
| 6229 | } never executed: end of block | 0 |
| 6230 | | - |
| 6231 | | - |
| 6232 | if (interactive == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6233 | print_offending_line (); never executed: print_offending_line (); | 0 |
| 6234 | } never executed: end of block | 0 |
| 6235 | else | - |
| 6236 | { | - |
| 6237 | msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error");| TRUE | evaluated 7 times by 1 test | | FALSE | never evaluated |
| 0-7 |
| 6238 | parser_error (line_number, "%s", msg); | - |
| 6239 | | - |
| 6240 | | - |
| 6241 | | - |
| 6242 | if (interactive && EOF_Reached)| TRUE | never evaluated | | FALSE | evaluated 7 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-7 |
| 6243 | EOF_Reached = 0; never executed: EOF_Reached = 0; | 0 |
| 6244 | }executed 7 times by 1 test: end of block | 7 |
| 6245 | | - |
| 6246 | last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE;| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 4 times by 1 test |
| 3-4 |
| 6247 | }executed 7 times by 1 test: end of block | 7 |
| 6248 | | - |
| 6249 | | - |
| 6250 | | - |
| 6251 | | - |
| 6252 | | - |
| 6253 | | - |
| 6254 | static void | - |
| 6255 | discard_parser_constructs (error_p) | - |
| 6256 | int error_p; | - |
| 6257 | { | - |
| 6258 | } | - |
| 6259 | | - |
| 6260 | | - |
| 6261 | | - |
| 6262 | | - |
| 6263 | | - |
| 6264 | | - |
| 6265 | | - |
| 6266 | | - |
| 6267 | | - |
| 6268 | | - |
| 6269 | int ignoreeof = 0; | - |
| 6270 | | - |
| 6271 | | - |
| 6272 | | - |
| 6273 | | - |
| 6274 | int eof_encountered = 0; | - |
| 6275 | | - |
| 6276 | | - |
| 6277 | int eof_encountered_limit = 10; | - |
| 6278 | | - |
| 6279 | | - |
| 6280 | | - |
| 6281 | | - |
| 6282 | | - |
| 6283 | static void | - |
| 6284 | handle_eof_input_unit () | - |
| 6285 | { | - |
| 6286 | if (interactive)| TRUE | never evaluated | | FALSE | evaluated 1292 times by 1 test |
| 0-1292 |
| 6287 | { | - |
| 6288 | | - |
| 6289 | | - |
| 6290 | | - |
| 6291 | if (EOF_Reached)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6292 | EOF_Reached = 0; never executed: EOF_Reached = 0; | 0 |
| 6293 | | - |
| 6294 | | - |
| 6295 | if (ignoreeof)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6296 | { | - |
| 6297 | if (eof_encountered < eof_encountered_limit)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6298 | { | - |
| 6299 | fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), | - |
| 6300 | login_shell ? "logout" : "exit"); | - |
| 6301 | eof_encountered++; | - |
| 6302 | | - |
| 6303 | last_read_token = current_token = '\n'; | - |
| 6304 | | - |
| 6305 | prompt_string_pointer = (char **)NULL; | - |
| 6306 | prompt_again (); | - |
| 6307 | return; never executed: return; | 0 |
| 6308 | } | - |
| 6309 | } never executed: end of block | 0 |
| 6310 | | - |
| 6311 | | - |
| 6312 | reset_parser (); | - |
| 6313 | exit_builtin ((WORD_LIST *)NULL); | - |
| 6314 | } never executed: end of block | 0 |
| 6315 | else | - |
| 6316 | { | - |
| 6317 | | - |
| 6318 | EOF_Reached = 1; | - |
| 6319 | }executed 1292 times by 1 test: end of block | 1292 |
| 6320 | } | - |
| 6321 | | - |
| 6322 | | - |
| 6323 | | - |
| 6324 | | - |
| 6325 | | - |
| 6326 | | - |
| 6327 | | - |
| 6328 | | - |
| 6329 | | - |
| 6330 | | - |
| 6331 | static WORD_LIST parse_string_error; | - |
| 6332 | | - |
| 6333 | | - |
| 6334 | | - |
| 6335 | WORD_LIST * | - |
| 6336 | parse_string_to_word_list (s, flags, whom) | - |
| 6337 | char *s; | - |
| 6338 | int flags; | - |
| 6339 | const char *whom; | - |
| 6340 | { | - |
| 6341 | WORD_LIST *wl; | - |
| 6342 | int tok, orig_current_token, orig_line_number, orig_input_terminator; | - |
| 6343 | int orig_line_count; | - |
| 6344 | int old_echo_input, old_expand_aliases; | - |
| 6345 | #if defined (HISTORY) | - |
| 6346 | int old_remember_on_history, old_history_expansion_inhibited; | - |
| 6347 | #endif | - |
| 6348 | | - |
| 6349 | #if defined (HISTORY) | - |
| 6350 | old_remember_on_history = remember_on_history; | - |
| 6351 | # if defined (BANG_HISTORY) | - |
| 6352 | old_history_expansion_inhibited = history_expansion_inhibited; | - |
| 6353 | # endif | - |
| 6354 | bash_history_disable (); | - |
| 6355 | #endif | - |
| 6356 | | - |
| 6357 | orig_line_number = line_number; | - |
| 6358 | orig_line_count = current_command_line_count; | - |
| 6359 | orig_input_terminator = shell_input_line_terminator; | - |
| 6360 | old_echo_input = echo_input_at_read; | - |
| 6361 | old_expand_aliases = expand_aliases; | - |
| 6362 | | - |
| 6363 | push_stream (1); | - |
| 6364 | last_read_token = WORD; | - |
| 6365 | current_command_line_count = 0; | - |
| 6366 | echo_input_at_read = expand_aliases = 0; | - |
| 6367 | | - |
| 6368 | with_input_from_string (s, whom); | - |
| 6369 | wl = (WORD_LIST *)NULL; | - |
| 6370 | | - |
| 6371 | if (flags & 1)| TRUE | evaluated 515 times by 1 test | | FALSE | never evaluated |
| 0-515 |
| 6372 | parser_state |= PST_COMPASSIGN|PST_REPARSE;executed 515 times by 1 test: parser_state |= 0x002000|0x040000; | 515 |
| 6373 | | - |
| 6374 | while ((tok = read_token (READ)) != yacc_EOF)| TRUE | evaluated 3477 times by 1 test | | FALSE | evaluated 28 times by 1 test |
| 28-3477 |
| 6375 | { | - |
| 6376 | if (tok == '\n' && *bash_input.location.string == '\0')| TRUE | evaluated 487 times by 1 test | | FALSE | evaluated 2990 times by 1 test |
| TRUE | evaluated 487 times by 1 test | | FALSE | never evaluated |
| 0-2990 |
| 6377 | break;executed 487 times by 1 test: break; | 487 |
| 6378 | if (tok == '\n') | TRUE | never evaluated | | FALSE | evaluated 2990 times by 1 test |
| 0-2990 |
| 6379 | continue; never executed: continue; | 0 |
| 6380 | if (tok != WORD && tok != ASSIGNMENT_WORD)| TRUE | evaluated 2112 times by 1 test | | FALSE | evaluated 878 times by 1 test |
| TRUE | never evaluated | | FALSE | evaluated 2112 times by 1 test |
| 0-2112 |
| 6381 | { | - |
| 6382 | line_number = orig_line_number + line_number - 1; | - |
| 6383 | orig_current_token = current_token; | - |
| 6384 | current_token = tok; | - |
| 6385 | yyerror (NULL); | - |
| 6386 | current_token = orig_current_token; | - |
| 6387 | if (wl)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6388 | dispose_words (wl); never executed: dispose_words (wl); | 0 |
| 6389 | wl = &parse_string_error; | - |
| 6390 | break; never executed: break; | 0 |
| 6391 | } | - |
| 6392 | wl = make_word_list (yylval.word, wl); | - |
| 6393 | }executed 2990 times by 1 test: end of block | 2990 |
| 6394 | | - |
| 6395 | last_read_token = '\n'; | - |
| 6396 | pop_stream (); | - |
| 6397 | | - |
| 6398 | #if defined (HISTORY) | - |
| 6399 | remember_on_history = old_remember_on_history; | - |
| 6400 | # if defined (BANG_HISTORY) | - |
| 6401 | history_expansion_inhibited = old_history_expansion_inhibited; | - |
| 6402 | # endif /* BANG_HISTORY */ | - |
| 6403 | #endif /* HISTORY */ | - |
| 6404 | | - |
| 6405 | echo_input_at_read = old_echo_input; | - |
| 6406 | expand_aliases = old_expand_aliases; | - |
| 6407 | | - |
| 6408 | current_command_line_count = orig_line_count; | - |
| 6409 | shell_input_line_terminator = orig_input_terminator; | - |
| 6410 | | - |
| 6411 | if (flags & 1)| TRUE | evaluated 515 times by 1 test | | FALSE | never evaluated |
| 0-515 |
| 6412 | parser_state &= ~(PST_COMPASSIGN|PST_REPARSE);executed 515 times by 1 test: parser_state &= ~(0x002000|0x040000); | 515 |
| 6413 | | - |
| 6414 | if (wl == &parse_string_error)| TRUE | never evaluated | | FALSE | evaluated 515 times by 1 test |
| 0-515 |
| 6415 | { | - |
| 6416 | last_command_exit_value = EXECUTION_FAILURE; | - |
| 6417 | if (interactive_shell == 0 && posixly_correct)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6418 | jump_to_top_level (FORCE_EOF); never executed: jump_to_top_level (1); | 0 |
| 6419 | else | - |
| 6420 | jump_to_top_level (DISCARD); never executed: jump_to_top_level (2); | 0 |
| 6421 | } | - |
| 6422 | | - |
| 6423 | return (REVERSE_LIST (wl, WORD_LIST *));executed 515 times by 1 test: return (((wl && wl->next) ? (WORD_LIST *)list_reverse ((GENERIC_LIST *)wl) : (WORD_LIST *)(wl))); | 515 |
| 6424 | } | - |
| 6425 | | - |
| 6426 | static char * | - |
| 6427 | parse_compound_assignment (retlenp) | - |
| 6428 | int *retlenp; | - |
| 6429 | { | - |
| 6430 | WORD_LIST *wl, *rl; | - |
| 6431 | int tok, orig_line_number, orig_token_size, orig_last_token, assignok; | - |
| 6432 | char *saved_token, *ret; | - |
| 6433 | | - |
| 6434 | saved_token = token; | - |
| 6435 | orig_token_size = token_buffer_size; | - |
| 6436 | orig_line_number = line_number; | - |
| 6437 | orig_last_token = last_read_token; | - |
| 6438 | | - |
| 6439 | last_read_token = WORD; | - |
| 6440 | | - |
| 6441 | token = (char *)NULL; | - |
| 6442 | token_buffer_size = 0; | - |
| 6443 | | - |
| 6444 | assignok = parser_state&PST_ASSIGNOK; | - |
| 6445 | | - |
| 6446 | wl = (WORD_LIST *)NULL; | - |
| 6447 | parser_state |= PST_COMPASSIGN; | - |
| 6448 | | - |
| 6449 | while ((tok = read_token (READ)) != ')')| TRUE | evaluated 3673 times by 1 test | | FALSE | evaluated 708 times by 1 test |
| 708-3673 |
| 6450 | { | - |
| 6451 | if (tok == '\n') | TRUE | evaluated 526 times by 1 test | | FALSE | evaluated 3147 times by 1 test |
| 526-3147 |
| 6452 | { | - |
| 6453 | if (SHOULD_PROMPT ())| TRUE | never evaluated | | FALSE | evaluated 526 times by 1 test |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-526 |
| 6454 | prompt_again (); never executed: prompt_again (); | 0 |
| 6455 | continue;executed 526 times by 1 test: continue; | 526 |
| 6456 | } | - |
| 6457 | if (tok != WORD && tok != ASSIGNMENT_WORD)| TRUE | evaluated 2076 times by 1 test | | FALSE | evaluated 1071 times by 1 test |
| TRUE | evaluated 17 times by 1 test | | FALSE | evaluated 2059 times by 1 test |
| 17-2076 |
| 6458 | { | - |
| 6459 | current_token = tok; | - |
| 6460 | if (tok == yacc_EOF) | TRUE | never evaluated | | FALSE | evaluated 17 times by 1 test |
| 0-17 |
| 6461 | parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); never executed: parser_error (orig_line_number, dcgettext (((void *)0), "unexpected EOF while looking for matching `)'" , 5) ); | 0 |
| 6462 | else | - |
| 6463 | yyerror(NULL); executed 17 times by 1 test: yyerror( ((void *)0) ); | 17 |
| 6464 | if (wl)| TRUE | evaluated 16 times by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1-16 |
| 6465 | dispose_words (wl);executed 16 times by 1 test: dispose_words (wl); | 16 |
| 6466 | wl = &parse_string_error; | - |
| 6467 | break;executed 17 times by 1 test: break; | 17 |
| 6468 | } | - |
| 6469 | wl = make_word_list (yylval.word, wl); | - |
| 6470 | }executed 3130 times by 1 test: end of block | 3130 |
| 6471 | | - |
| 6472 | FREE (token);executed 660 times by 1 test: sh_xfree((token), "./parse.y", 6472); | TRUE | evaluated 660 times by 1 test | | FALSE | evaluated 65 times by 1 test |
| 65-660 |
| 6473 | token = saved_token; | - |
| 6474 | token_buffer_size = orig_token_size; | - |
| 6475 | | - |
| 6476 | parser_state &= ~PST_COMPASSIGN; | - |
| 6477 | | - |
| 6478 | if (wl == &parse_string_error)| TRUE | evaluated 17 times by 1 test | | FALSE | evaluated 708 times by 1 test |
| 17-708 |
| 6479 | { | - |
| 6480 | last_command_exit_value = EXECUTION_FAILURE; | - |
| 6481 | last_read_token = '\n'; | - |
| 6482 | if (interactive_shell == 0 && posixly_correct)| TRUE | evaluated 17 times by 1 test | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | evaluated 17 times by 1 test |
| 0-17 |
| 6483 | jump_to_top_level (FORCE_EOF); never executed: jump_to_top_level (1); | 0 |
| 6484 | else | - |
| 6485 | jump_to_top_level (DISCARD);executed 17 times by 1 test: jump_to_top_level (2); | 17 |
| 6486 | } | - |
| 6487 | | - |
| 6488 | last_read_token = orig_last_token; | - |
| 6489 | | - |
| 6490 | if (wl)| TRUE | evaluated 644 times by 1 test | | FALSE | evaluated 64 times by 1 test |
| 64-644 |
| 6491 | { | - |
| 6492 | rl = REVERSE_LIST (wl, WORD_LIST *);| TRUE | evaluated 644 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 279 times by 1 test | | FALSE | evaluated 365 times by 1 test |
| 0-644 |
| 6493 | ret = string_list (rl); | - |
| 6494 | dispose_words (rl); | - |
| 6495 | }executed 644 times by 1 test: end of block | 644 |
| 6496 | else | - |
| 6497 | ret = (char *)NULL;executed 64 times by 1 test: ret = (char *) ((void *)0) ; | 64 |
| 6498 | | - |
| 6499 | if (retlenp)| TRUE | evaluated 708 times by 1 test | | FALSE | never evaluated |
| 0-708 |
| 6500 | *retlenp = (ret && *ret) ? strlen (ret) : 0;executed 708 times by 1 test: *retlenp = (ret && *ret) ? strlen (ret) : 0; | TRUE | evaluated 644 times by 1 test | | FALSE | evaluated 64 times by 1 test |
| TRUE | evaluated 644 times by 1 test | | FALSE | never evaluated |
| 0-708 |
| 6501 | | - |
| 6502 | if (assignok)| TRUE | evaluated 122 times by 1 test | | FALSE | evaluated 586 times by 1 test |
| 122-586 |
| 6503 | parser_state |= PST_ASSIGNOK;executed 122 times by 1 test: parser_state |= 0x004000; | 122 |
| 6504 | | - |
| 6505 | return ret;executed 708 times by 1 test: return ret; | 708 |
| 6506 | } | - |
| 6507 | | - |
| 6508 | | - |
| 6509 | | - |
| 6510 | | - |
| 6511 | | - |
| 6512 | | - |
| 6513 | | - |
| 6514 | sh_parser_state_t * | - |
| 6515 | save_parser_state (ps) | - |
| 6516 | sh_parser_state_t *ps; | - |
| 6517 | { | - |
| 6518 | if (ps == 0)| TRUE | never evaluated | | FALSE | evaluated 707380 times by 1 test |
| 0-707380 |
| 6519 | ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); never executed: ps = (sh_parser_state_t *)sh_xmalloc((sizeof (sh_parser_state_t)), "./parse.y", 6519); | 0 |
| 6520 | if (ps == 0)| TRUE | never evaluated | | FALSE | evaluated 707380 times by 1 test |
| 0-707380 |
| 6521 | return ((sh_parser_state_t *)NULL); never executed: return ((sh_parser_state_t *) ((void *)0) ); | 0 |
| 6522 | | - |
| 6523 | ps->parser_state = parser_state; | - |
| 6524 | ps->token_state = save_token_state (); | - |
| 6525 | | - |
| 6526 | ps->input_line_terminator = shell_input_line_terminator; | - |
| 6527 | ps->eof_encountered = eof_encountered; | - |
| 6528 | | - |
| 6529 | ps->prompt_string_pointer = prompt_string_pointer; | - |
| 6530 | | - |
| 6531 | ps->current_command_line_count = current_command_line_count; | - |
| 6532 | | - |
| 6533 | #if defined (HISTORY) | - |
| 6534 | ps->remember_on_history = remember_on_history; | - |
| 6535 | # if defined (BANG_HISTORY) | - |
| 6536 | ps->history_expansion_inhibited = history_expansion_inhibited; | - |
| 6537 | # endif | - |
| 6538 | #endif | - |
| 6539 | | - |
| 6540 | ps->last_command_exit_value = last_command_exit_value; | - |
| 6541 | #if defined (ARRAY_VARS) | - |
| 6542 | ps->pipestatus = save_pipestatus_array (); | - |
| 6543 | #endif | - |
| 6544 | | - |
| 6545 | ps->last_shell_builtin = last_shell_builtin; | - |
| 6546 | ps->this_shell_builtin = this_shell_builtin; | - |
| 6547 | | - |
| 6548 | ps->expand_aliases = expand_aliases; | - |
| 6549 | ps->echo_input_at_read = echo_input_at_read; | - |
| 6550 | ps->need_here_doc = need_here_doc; | - |
| 6551 | ps->here_doc_first_line = here_doc_first_line; | - |
| 6552 | | - |
| 6553 | if (need_here_doc == 0)| TRUE | evaluated 707380 times by 1 test | | FALSE | never evaluated |
| 0-707380 |
| 6554 | ps->redir_stack[0] = 0;executed 707380 times by 1 test: ps->redir_stack[0] = 0; | 707380 |
| 6555 | else | - |
| 6556 | memcpy (ps->redir_stack, redir_stack, sizeof (redir_stack[0]) * HEREDOC_MAX); never executed: memcpy (ps->redir_stack, redir_stack, sizeof (redir_stack[0]) * 16); | 0 |
| 6557 | | - |
| 6558 | ps->token = token; | - |
| 6559 | ps->token_buffer_size = token_buffer_size; | - |
| 6560 | | - |
| 6561 | token = 0; | - |
| 6562 | token_buffer_size = 0; | - |
| 6563 | | - |
| 6564 | return (ps);executed 707380 times by 1 test: return (ps); | 707380 |
| 6565 | } | - |
| 6566 | | - |
| 6567 | void | - |
| 6568 | restore_parser_state (ps) | - |
| 6569 | sh_parser_state_t *ps; | - |
| 6570 | { | - |
| 6571 | int i; | - |
| 6572 | | - |
| 6573 | if (ps == 0)| TRUE | never evaluated | | FALSE | evaluated 707380 times by 1 test |
| 0-707380 |
| 6574 | return; never executed: return; | 0 |
| 6575 | | - |
| 6576 | parser_state = ps->parser_state; | - |
| 6577 | if (ps->token_state)| TRUE | evaluated 707380 times by 1 test | | FALSE | never evaluated |
| 0-707380 |
| 6578 | { | - |
| 6579 | restore_token_state (ps->token_state); | - |
| 6580 | free (ps->token_state); | - |
| 6581 | }executed 707380 times by 1 test: end of block | 707380 |
| 6582 | | - |
| 6583 | shell_input_line_terminator = ps->input_line_terminator; | - |
| 6584 | eof_encountered = ps->eof_encountered; | - |
| 6585 | | - |
| 6586 | prompt_string_pointer = ps->prompt_string_pointer; | - |
| 6587 | | - |
| 6588 | current_command_line_count = ps->current_command_line_count; | - |
| 6589 | | - |
| 6590 | #if defined (HISTORY) | - |
| 6591 | remember_on_history = ps->remember_on_history; | - |
| 6592 | # if defined (BANG_HISTORY) | - |
| 6593 | history_expansion_inhibited = ps->history_expansion_inhibited; | - |
| 6594 | # endif | - |
| 6595 | #endif | - |
| 6596 | | - |
| 6597 | last_command_exit_value = ps->last_command_exit_value; | - |
| 6598 | #if defined (ARRAY_VARS) | - |
| 6599 | restore_pipestatus_array (ps->pipestatus); | - |
| 6600 | #endif | - |
| 6601 | | - |
| 6602 | last_shell_builtin = ps->last_shell_builtin; | - |
| 6603 | this_shell_builtin = ps->this_shell_builtin; | - |
| 6604 | | - |
| 6605 | expand_aliases = ps->expand_aliases; | - |
| 6606 | echo_input_at_read = ps->echo_input_at_read; | - |
| 6607 | need_here_doc = ps->need_here_doc; | - |
| 6608 | here_doc_first_line = ps->here_doc_first_line; | - |
| 6609 | | - |
| 6610 | #if 0 | - |
| 6611 | for (i = 0; i < HEREDOC_MAX; i++) | - |
| 6612 | redir_stack[i] = ps->redir_stack[i]; | - |
| 6613 | #else | - |
| 6614 | if (need_here_doc == 0)| TRUE | evaluated 707380 times by 1 test | | FALSE | never evaluated |
| 0-707380 |
| 6615 | redir_stack[0] = 0;executed 707380 times by 1 test: redir_stack[0] = 0; | 707380 |
| 6616 | else | - |
| 6617 | memcpy (redir_stack, ps->redir_stack, sizeof (redir_stack[0]) * HEREDOC_MAX); never executed: memcpy (redir_stack, ps->redir_stack, sizeof (redir_stack[0]) * 16); | 0 |
| 6618 | #endif | - |
| 6619 | | - |
| 6620 | FREE (token);executed 707228 times by 1 test: sh_xfree((token), "./parse.y", 6620); | TRUE | evaluated 707228 times by 1 test | | FALSE | evaluated 152 times by 1 test |
| 152-707228 |
| 6621 | token = ps->token; | - |
| 6622 | token_buffer_size = ps->token_buffer_size; | - |
| 6623 | }executed 707380 times by 1 test: end of block | 707380 |
| 6624 | | - |
| 6625 | sh_input_line_state_t * | - |
| 6626 | save_input_line_state (ls) | - |
| 6627 | sh_input_line_state_t *ls; | - |
| 6628 | { | - |
| 6629 | if (ls == 0)| TRUE | never evaluated | | FALSE | evaluated 705307 times by 1 test |
| 0-705307 |
| 6630 | ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); never executed: ls = (sh_input_line_state_t *)sh_xmalloc((sizeof (sh_input_line_state_t)), "./parse.y", 6630); | 0 |
| 6631 | if (ls == 0)| TRUE | never evaluated | | FALSE | evaluated 705307 times by 1 test |
| 0-705307 |
| 6632 | return ((sh_input_line_state_t *)NULL); never executed: return ((sh_input_line_state_t *) ((void *)0) ); | 0 |
| 6633 | | - |
| 6634 | ls->input_line = shell_input_line; | - |
| 6635 | ls->input_line_size = shell_input_line_size; | - |
| 6636 | ls->input_line_len = shell_input_line_len; | - |
| 6637 | ls->input_line_index = shell_input_line_index; | - |
| 6638 | | - |
| 6639 | | - |
| 6640 | shell_input_line = 0; | - |
| 6641 | shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; | - |
| 6642 | | - |
| 6643 | return ls;executed 705307 times by 1 test: return ls; | 705307 |
| 6644 | } | - |
| 6645 | | - |
| 6646 | void | - |
| 6647 | restore_input_line_state (ls) | - |
| 6648 | sh_input_line_state_t *ls; | - |
| 6649 | { | - |
| 6650 | FREE (shell_input_line); never executed: sh_xfree((shell_input_line), "./parse.y", 6650); | TRUE | never evaluated | | FALSE | evaluated 705307 times by 1 test |
| 0-705307 |
| 6651 | shell_input_line = ls->input_line; | - |
| 6652 | shell_input_line_size = ls->input_line_size; | - |
| 6653 | shell_input_line_len = ls->input_line_len; | - |
| 6654 | shell_input_line_index = ls->input_line_index; | - |
| 6655 | | - |
| 6656 | set_line_mbstate (); | - |
| 6657 | }executed 705307 times by 1 test: end of block | 705307 |
| 6658 | | - |
| 6659 | | - |
| 6660 | | - |
| 6661 | | - |
| 6662 | | - |
| 6663 | | - |
| 6664 | | - |
| 6665 | #if defined (HANDLE_MULTIBYTE) | - |
| 6666 | | - |
| 6667 | | - |
| 6668 | #define MAX_PROPSIZE 32768 | - |
| 6669 | | - |
| 6670 | static void | - |
| 6671 | set_line_mbstate () | - |
| 6672 | { | - |
| 6673 | int c; | - |
| 6674 | size_t i, previ, len; | - |
| 6675 | mbstate_t mbs, prevs; | - |
| 6676 | size_t mbclen; | - |
| 6677 | | - |
| 6678 | if (shell_input_line == NULL)| TRUE | evaluated 22 times by 1 test | | FALSE | evaluated 3635148 times by 1 test |
| 22-3635148 |
| 6679 | return;executed 22 times by 1 test: return; | 22 |
| 6680 | len = strlen (shell_input_line); | - |
| 6681 | if (len == 0)| TRUE | evaluated 63687 times by 1 test | | FALSE | evaluated 3571461 times by 1 test |
| 63687-3571461 |
| 6682 | return;executed 63687 times by 1 test: return; | 63687 |
| 6683 | if (shell_input_line_propsize >= MAX_PROPSIZE && len < MAX_PROPSIZE>>1)| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 3571459 times by 1 test |
| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1-3571459 |
| 6684 | { | - |
| 6685 | free (shell_input_line_property); | - |
| 6686 | shell_input_line_property = 0; | - |
| 6687 | shell_input_line_propsize = 0; | - |
| 6688 | }executed 1 time by 1 test: end of block | 1 |
| 6689 | if (len+1 > shell_input_line_propsize)| TRUE | evaluated 58269 times by 1 test | | FALSE | evaluated 3513192 times by 1 test |
| 58269-3513192 |
| 6690 | { | - |
| 6691 | shell_input_line_propsize = len + 1; | - |
| 6692 | shell_input_line_property = (char *)xrealloc (shell_input_line_property, shell_input_line_propsize); | - |
| 6693 | }executed 58269 times by 1 test: end of block | 58269 |
| 6694 | | - |
| 6695 | | - |
| 6696 | | - |
| 6697 | memset (&prevs, '\0', sizeof (mbstate_t)); | - |
| 6698 | for (i = previ = 0; i < len; i++)| TRUE | evaluated 43543997 times by 1 test | | FALSE | evaluated 3571461 times by 1 test |
| 3571461-43543997 |
| 6699 | { | - |
| 6700 | mbs = prevs; | - |
| 6701 | | - |
| 6702 | c = shell_input_line[i]; | - |
| 6703 | if (c == EOF)| TRUE | never evaluated | | FALSE | evaluated 43543997 times by 1 test |
| 0-43543997 |
| 6704 | { | - |
| 6705 | size_t j; | - |
| 6706 | for (j = i; j < len; j++)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6707 | shell_input_line_property[j] = 1; never executed: shell_input_line_property[j] = 1; | 0 |
| 6708 | break; never executed: break; | 0 |
| 6709 | } | - |
| 6710 | | - |
| 6711 | | - |
| 6712 | | - |
| 6713 | | - |
| 6714 | mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); | - |
| 6715 | if (mbclen == 1 || mbclen == (size_t)-1)| TRUE | evaluated 43536721 times by 1 test | | FALSE | evaluated 7276 times by 1 test |
| TRUE | evaluated 426 times by 1 test | | FALSE | evaluated 6850 times by 1 test |
| 426-43536721 |
| 6716 | { | - |
| 6717 | mbclen = 1; | - |
| 6718 | previ = i + 1; | - |
| 6719 | }executed 43537147 times by 1 test: end of block | 43537147 |
| 6720 | else if (mbclen == (size_t)-2)| TRUE | evaluated 4352 times by 1 test | | FALSE | evaluated 2498 times by 1 test |
| 2498-4352 |
| 6721 | mbclen = 0;executed 4352 times by 1 test: mbclen = 0; | 4352 |
| 6722 | else if (mbclen > 1)| TRUE | evaluated 2498 times by 1 test | | FALSE | never evaluated |
| 0-2498 |
| 6723 | { | - |
| 6724 | mbclen = 0; | - |
| 6725 | previ = i + 1; | - |
| 6726 | prevs = mbs; | - |
| 6727 | }executed 2498 times by 1 test: end of block | 2498 |
| 6728 | else | - |
| 6729 | { | - |
| 6730 | | - |
| 6731 | size_t j; | - |
| 6732 | for (j = i; j < len; j++)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 6733 | shell_input_line_property[j] = 1; never executed: shell_input_line_property[j] = 1; | 0 |
| 6734 | break; never executed: break; | 0 |
| 6735 | } | - |
| 6736 | | - |
| 6737 | shell_input_line_property[i] = mbclen; | - |
| 6738 | }executed 43543997 times by 1 test: end of block | 43543997 |
| 6739 | }executed 3571461 times by 1 test: end of block | 3571461 |
| 6740 | #endif /* HANDLE_MULTIBYTE */ | - |
| | |