- Timestamp:
- Feb 15, 2012, 9:54:06 AM (13 years ago)
- Branches:
- clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- dbcaa8a
- Parents:
- 8a48307
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
patches/bash-4.2-branch_update-3.patch
r8a48307 rd01d386 1 Submitted By: Jonathan Norman (jonathan at bluesquarelinux .co.uk)2 Date: 2011-05-161 Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk) 2 Date: 15-02-2012 3 3 Initial Package Version: 4.2 4 4 Origin: Upstream 5 5 Upstream Status: Applied 6 Description: Contains all upstream patches up to 4.2-0 106 Description: Contains all upstream patches up to 4.2-020 7 7 8 diff -Naur bash-4.2.orig/assoc.c bash-4.2/assoc.c 9 --- bash-4.2.orig/assoc.c 2009-08-06 00:19:40.000000000 +0000 10 +++ bash-4.2/assoc.c 2012-02-15 17:04:56.844640185 +0000 11 @@ -77,6 +77,11 @@ 12 b = hash_search (key, hash, HASH_CREATE); 13 if (b == 0) 14 return -1; 15 + /* If we are overwriting an existing element's value, we're not going to 16 + use the key. Nothing in the array assignment code path frees the key 17 + string, so we can free it here to avoid a memory leak. */ 18 + if (b->key != key) 19 + free (key); 20 FREE (b->data); 21 b->data = value ? savestring (value) : (char *)0; 22 return (0); 23 diff -Naur bash-4.2.orig/builtins/declare.def bash-4.2/builtins/declare.def 24 --- bash-4.2.orig/builtins/declare.def 2010-05-30 22:25:21.000000000 +0000 25 +++ bash-4.2/builtins/declare.def 2012-02-15 17:05:08.352946800 +0000 26 @@ -513,6 +513,11 @@ 27 *subscript_start = '['; /* ] */ 28 var = assign_array_element (name, value, 0); /* XXX - not aflags */ 29 *subscript_start = '\0'; 30 + if (var == 0) /* some kind of assignment error */ 31 + { 32 + assign_error++; 33 + NEXT_VARIABLE (); 34 + } 35 } 36 else if (simple_array_assign) 37 { 8 38 diff -Naur bash-4.2.orig/builtins/fc.def bash-4.2/builtins/fc.def 9 39 --- bash-4.2.orig/builtins/fc.def 2010-05-30 22:25:38.000000000 +0000 10 +++ bash-4.2/builtins/fc.def 201 1-05-16 23:42:00.796961011+000040 +++ bash-4.2/builtins/fc.def 2012-02-15 17:04:54.028565156 +0000 11 41 @@ -304,7 +304,7 @@ 12 42 last_hist = i - rh - hist_last_line_added; … … 46 76 diff -Naur bash-4.2.orig/builtins/printf.def bash-4.2/builtins/printf.def 47 77 --- bash-4.2.orig/builtins/printf.def 2010-11-23 15:02:55.000000000 +0000 48 +++ bash-4.2/builtins/printf.def 201 1-05-16 23:41:55.617535899+000078 +++ bash-4.2/builtins/printf.def 2012-02-15 17:04:48.484417444 +0000 49 79 @@ -465,6 +465,9 @@ 50 80 secs = shell_start_time; /* roughly $SECONDS */ … … 57 87 n = strftime (timebuf, sizeof (timebuf), timefmt, tm); 58 88 free (timefmt); 89 diff -Naur bash-4.2.orig/builtins/read.def bash-4.2/builtins/read.def 90 --- bash-4.2.orig/builtins/read.def 2011-01-04 16:43:36.000000000 +0000 91 +++ bash-4.2/builtins/read.def 2012-02-15 17:05:05.540871876 +0000 92 @@ -642,6 +642,12 @@ 93 xfree (input_string); 94 return EXECUTION_FAILURE; /* readonly or noassign */ 95 } 96 + if (assoc_p (var)) 97 + { 98 + builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); 99 + xfree (input_string); 100 + return EXECUTION_FAILURE; /* existing associative array */ 101 + } 102 array_flush (array_cell (var)); 103 104 alist = list_string (input_string, ifs_chars, 0); 105 diff -Naur bash-4.2.orig/execute_cmd.c bash-4.2/execute_cmd.c 106 --- bash-4.2.orig/execute_cmd.c 2011-02-09 22:32:25.000000000 +0000 107 +++ bash-4.2/execute_cmd.c 2012-02-15 17:05:06.964909819 +0000 108 @@ -2196,6 +2196,7 @@ 109 if (ignore_return && cmd) 110 cmd->flags |= CMD_IGNORE_RETURN; 111 112 +#if defined (JOB_CONTROL) 113 lastpipe_flag = 0; 114 begin_unwind_frame ("lastpipe-exec"); 115 lstdin = -1; 116 @@ -2215,15 +2216,19 @@ 117 lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL); /* XXX */ 118 add_unwind_protect (lastpipe_cleanup, lastpipe_jid); 119 } 120 - cmd->flags |= CMD_LASTPIPE; 121 + if (cmd) 122 + cmd->flags |= CMD_LASTPIPE; 123 } 124 if (prev >= 0) 125 add_unwind_protect (close, prev); 126 +#endif 127 128 exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close); 129 130 +#if defined (JOB_CONTROL) 131 if (lstdin > 0) 132 restore_stdin (lstdin); 133 +#endif 134 135 if (prev >= 0) 136 close (prev); 137 diff -Naur bash-4.2.orig/expr.c bash-4.2/expr.c 138 --- bash-4.2.orig/expr.c 2010-12-21 16:12:13.000000000 +0000 139 +++ bash-4.2/expr.c 2012-02-15 17:05:02.424788857 +0000 140 @@ -476,19 +476,23 @@ 141 142 if (special) 143 { 144 + if ((op == DIV || op == MOD) && value == 0) 145 + { 146 + if (noeval == 0) 147 + evalerror (_("division by 0")); 148 + else 149 + value = 1; 150 + } 151 + 152 switch (op) 153 { 154 case MUL: 155 lvalue *= value; 156 break; 157 case DIV: 158 - if (value == 0) 159 - evalerror (_("division by 0")); 160 lvalue /= value; 161 break; 162 case MOD: 163 - if (value == 0) 164 - evalerror (_("division by 0")); 165 lvalue %= value; 166 break; 167 case PLUS: 168 @@ -804,7 +808,12 @@ 169 val2 = exppower (); 170 171 if (((op == DIV) || (op == MOD)) && (val2 == 0)) 172 - evalerror (_("division by 0")); 173 + { 174 + if (noeval == 0) 175 + evalerror (_("division by 0")); 176 + else 177 + val2 = 1; 178 + } 179 180 if (op == MUL) 181 val1 *= val2; 59 182 diff -Naur bash-4.2.orig/lib/glob/gmisc.c bash-4.2/lib/glob/gmisc.c 60 183 --- bash-4.2.orig/lib/glob/gmisc.c 2011-02-05 21:11:17.000000000 +0000 61 +++ bash-4.2/lib/glob/gmisc.c 201 1-05-16 23:41:53.037822234+0000184 +++ bash-4.2/lib/glob/gmisc.c 2012-02-15 17:04:45.660342203 +0000 62 185 @@ -77,8 +77,8 @@ 63 186 wchar_t *wpat; … … 262 385 diff -Naur bash-4.2.orig/lib/readline/callback.c bash-4.2/lib/readline/callback.c 263 386 --- bash-4.2.orig/lib/readline/callback.c 2010-06-06 16:18:58.000000000 +0000 264 +++ bash-4.2/lib/readline/callback.c 201 1-05-16 23:41:51.689971838+0000387 +++ bash-4.2/lib/readline/callback.c 2012-02-15 17:04:43.812292965 +0000 265 388 @@ -148,6 +148,9 @@ 266 389 eof = _rl_vi_domove_callback (_rl_vimvcxt); … … 275 398 diff -Naur bash-4.2.orig/lib/readline/vi_mode.c bash-4.2/lib/readline/vi_mode.c 276 399 --- bash-4.2.orig/lib/readline/vi_mode.c 2010-11-21 00:51:39.000000000 +0000 277 +++ bash-4.2/lib/readline/vi_mode.c 201 1-05-16 23:41:51.689971838+0000400 +++ bash-4.2/lib/readline/vi_mode.c 2012-02-15 17:04:43.812292965 +0000 278 401 @@ -1114,7 +1114,7 @@ 279 402 rl_beg_of_line (1, c); … … 287 410 diff -Naur bash-4.2.orig/parse.y bash-4.2/parse.y 288 411 --- bash-4.2.orig/parse.y 2011-01-02 20:48:11.000000000 +0000 289 +++ bash-4.2/parse.y 2011-05-16 23:41:55.613536343 +0000 290 @@ -5135,6 +5135,9 @@ 412 +++ bash-4.2/parse.y 2012-02-15 17:05:04.008831060 +0000 413 @@ -2499,7 +2499,7 @@ 414 We do this only if it is time to do so. Notice that only here 415 is the mail alarm reset; nothing takes place in check_mail () 416 except the checking of mail. Please don't change this. */ 417 - if (prompt_is_ps1 && time_to_check_mail ()) 418 + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) 419 { 420 check_mail (); 421 reset_mail_timer (); 422 @@ -3842,6 +3842,7 @@ 423 int flags; 424 { 425 sh_parser_state_t ps; 426 + sh_input_line_state_t ls; 427 int orig_ind, nc, sflags; 428 char *ret, *s, *ep, *ostring; 429 430 @@ -3849,10 +3850,12 @@ 431 orig_ind = *indp; 432 ostring = string; 433 434 +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ 435 sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; 436 if (flags & SX_NOLONGJMP) 437 sflags |= SEVAL_NOLONGJMP; 438 save_parser_state (&ps); 439 + save_input_line_state (&ls); 440 441 /*(*/ 442 parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ 443 @@ -3861,6 +3864,8 @@ 444 445 restore_parser_state (&ps); 446 reset_parser (); 447 + /* reset_parser clears shell_input_line and associated variables */ 448 + restore_input_line_state (&ls); 449 if (interactive) 450 token_to_read = 0; 451 452 @@ -5135,6 +5140,9 @@ 291 453 case 'A': 292 454 /* Make the current time/date into a string. */ … … 298 460 299 461 if (c == 'd') 462 @@ -5905,6 +5913,12 @@ 463 ps->expand_aliases = expand_aliases; 464 ps->echo_input_at_read = echo_input_at_read; 465 466 + ps->token = token; 467 + ps->token_buffer_size = token_buffer_size; 468 + /* Force reallocation on next call to read_token_word */ 469 + token = 0; 470 + token_buffer_size = 0; 471 + 472 return (ps); 473 } 474 475 @@ -5946,6 +5960,42 @@ 476 477 expand_aliases = ps->expand_aliases; 478 echo_input_at_read = ps->echo_input_at_read; 479 + 480 + FREE (token); 481 + token = ps->token; 482 + token_buffer_size = ps->token_buffer_size; 483 +} 484 + 485 +sh_input_line_state_t * 486 +save_input_line_state (ls) 487 + sh_input_line_state_t *ls; 488 +{ 489 + if (ls == 0) 490 + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); 491 + if (ls == 0) 492 + return ((sh_input_line_state_t *)NULL); 493 + 494 + ls->input_line = shell_input_line; 495 + ls->input_line_size = shell_input_line_size; 496 + ls->input_line_len = shell_input_line_len; 497 + ls->input_line_index = shell_input_line_index; 498 + 499 + /* force reallocation */ 500 + shell_input_line = 0; 501 + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; 502 +} 503 + 504 +void 505 +restore_input_line_state (ls) 506 + sh_input_line_state_t *ls; 507 +{ 508 + FREE (shell_input_line); 509 + shell_input_line = ls->input_line; 510 + shell_input_line_size = ls->input_line_size; 511 + shell_input_line_len = ls->input_line_len; 512 + shell_input_line_index = ls->input_line_index; 513 + 514 + set_line_mbstate (); 515 } 516 517 /************************************************ 300 518 diff -Naur bash-4.2.orig/patchlevel.h bash-4.2/patchlevel.h 301 519 --- bash-4.2.orig/patchlevel.h 2010-06-13 00:14:48.000000000 +0000 302 +++ bash-4.2/patchlevel.h 201 1-05-16 23:42:02.092817179+0000520 +++ bash-4.2/patchlevel.h 2012-02-15 17:05:09.844986552 +0000 303 521 @@ -25,6 +25,6 @@ 304 522 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh … … 306 524 307 525 -#define PATCHLEVEL 0 308 +#define PATCHLEVEL 10526 +#define PATCHLEVEL 20 309 527 310 528 #endif /* _PATCHLEVEL_H_ */ 529 diff -Naur bash-4.2.orig/pathexp.c bash-4.2/pathexp.c 530 --- bash-4.2.orig/pathexp.c 2010-08-14 03:21:57.000000000 +0000 531 +++ bash-4.2/pathexp.c 2012-02-15 17:05:01.036751874 +0000 532 @@ -196,7 +196,7 @@ 533 { 534 if ((qflags & QGLOB_FILENAME) && pathname[i+1] == '/') 535 continue; 536 - if ((qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0) 537 + if (pathname[i+1] != CTLESC && (qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0) 538 continue; 539 temp[j++] = '\\'; 540 i++; 311 541 diff -Naur bash-4.2.orig/print_cmd.c bash-4.2/print_cmd.c 312 542 --- bash-4.2.orig/print_cmd.c 2010-05-30 22:34:08.000000000 +0000 313 +++ bash-4.2/print_cmd.c 201 1-05-16 23:42:02.092817179+0000543 +++ bash-4.2/print_cmd.c 2012-02-15 17:04:55.440602777 +0000 314 544 @@ -315,6 +315,7 @@ 315 545 cprintf ("( "); … … 336 566 if (inside_function_def) 337 567 { 568 diff -Naur bash-4.2.orig/shell.h bash-4.2/shell.h 569 --- bash-4.2.orig/shell.h 2011-01-07 03:16:55.000000000 +0000 570 +++ bash-4.2/shell.h 2012-02-15 17:04:58.268678125 +0000 571 @@ -136,6 +136,9 @@ 572 int parser_state; 573 int *token_state; 574 575 + char *token; 576 + int token_buffer_size; 577 + 578 /* input line state -- line number saved elsewhere */ 579 int input_line_terminator; 580 int eof_encountered; 581 @@ -166,6 +169,16 @@ 582 583 } sh_parser_state_t; 584 585 +typedef struct _sh_input_line_state_t { 586 + char *input_line; 587 + int input_line_index; 588 + int input_line_size; 589 + int input_line_len; 590 +} sh_input_line_state_t; 591 + 592 /* Let's try declaring these here. */ 593 extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *)); 594 extern void restore_parser_state __P((sh_parser_state_t *)); 595 + 596 +extern sh_input_line_state_t *save_input_line_state __P((sh_input_line_state_t *)); 597 +extern void restore_input_line_state __P((sh_input_line_state_t *)); 338 598 diff -Naur bash-4.2.orig/sig.c bash-4.2/sig.c 339 599 --- bash-4.2.orig/sig.c 2010-11-23 13:21:22.000000000 +0000 340 +++ bash-4.2/sig.c 201 1-05-16 23:41:59.501104844+0000600 +++ bash-4.2/sig.c 2012-02-15 17:04:52.644528282 +0000 341 601 @@ -46,6 +46,7 @@ 342 602 … … 369 629 diff -Naur bash-4.2.orig/subst.c bash-4.2/subst.c 370 630 --- bash-4.2.orig/subst.c 2011-01-02 21:12:51.000000000 +0000 371 +++ bash-4.2/subst.c 201 1-05-16 23:41:58.205248678+0000631 +++ bash-4.2/subst.c 2012-02-15 17:04:59.656715107 +0000 372 632 @@ -1379,10 +1379,12 @@ 373 633 slen = strlen (string + *sindex) + *sindex; … … 396 656 tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); 397 657 return (tresult); 398 @@ -4607,6 +4609,7 @@ 658 @@ -3704,7 +3706,10 @@ 659 break; 660 } 661 else if (string[i] == CTLNUL) 662 - i++; 663 + { 664 + i++; 665 + continue; 666 + } 667 668 prev_i = i; 669 ADVANCE_CHAR (string, slen, i); 670 @@ -4607,6 +4612,7 @@ 399 671 if (ifs_firstc == 0) 400 672 #endif … … 404 676 expand_no_split_dollar_star = 0; 405 677 406 @@ -7176,7 +71 79,7 @@678 @@ -7176,7 +7182,7 @@ 407 679 { 408 680 /* Extract the contents of the ${ ... } expansion … … 415 687 diff -Naur bash-4.2.orig/subst.h bash-4.2/subst.h 416 688 --- bash-4.2.orig/subst.h 2010-12-03 01:21:29.000000000 +0000 417 +++ bash-4.2/subst.h 201 1-05-16 23:41:50.378117447+0000689 +++ bash-4.2/subst.h 2012-02-15 17:04:42.280252148 +0000 418 690 @@ -56,6 +56,7 @@ 419 691 #define SX_NOLONGJMP 0x0040 /* don't longjmp on fatal error */ … … 424 696 /* Remove backslashes which are quoting backquotes from STRING. Modifies 425 697 STRING, and returns a pointer to it. */ 698 diff -Naur bash-4.2.orig/support/shobj-conf bash-4.2/support/shobj-conf 699 --- bash-4.2.orig/support/shobj-conf 2009-10-28 13:20:21.000000000 +0000 700 +++ bash-4.2/support/shobj-conf 2012-02-15 17:05:09.844986552 +0000 701 @@ -157,7 +157,7 @@ 702 ;; 703 704 # Darwin/MacOS X 705 -darwin[89]*|darwin10*) 706 +darwin[89]*|darwin1[012]*) 707 SHOBJ_STATUS=supported 708 SHLIB_STATUS=supported 709 710 @@ -186,7 +186,7 @@ 711 SHLIB_LIBSUFF='dylib' 712 713 case "${host_os}" in 714 - darwin[789]*|darwin10*) SHOBJ_LDFLAGS='' 715 + darwin[789]*|darwin1[012]*) SHOBJ_LDFLAGS='' 716 SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' 717 ;; 718 *) SHOBJ_LDFLAGS='-dynamic' 426 719 diff -Naur bash-4.2.orig/variables.c bash-4.2/variables.c 427 720 --- bash-4.2.orig/variables.c 2011-01-25 01:07:48.000000000 +0000 428 +++ bash-4.2/variables.c 201 1-05-16 23:41:56.917391622+0000721 +++ bash-4.2/variables.c 2012-02-15 17:04:49.868454320 +0000 429 722 @@ -3653,6 +3653,22 @@ 430 723 return n; … … 477 770 diff -Naur bash-4.2.orig/variables.h bash-4.2/variables.h 478 771 --- bash-4.2.orig/variables.h 2010-12-03 01:22:01.000000000 +0000 479 +++ bash-4.2/variables.h 201 1-05-16 23:41:55.613536343+0000772 +++ bash-4.2/variables.h 2012-02-15 17:04:48.476417232 +0000 480 773 @@ -313,6 +313,7 @@ 481 774
Note:
See TracChangeset
for help on using the changeset viewer.