source:
patches/bash-4.3-branch_update-2.patch@
bc61a24b
Last change on this file since bc61a24b was 94a653a, checked in by , 11 years ago | |
---|---|
|
|
File size: 13.7 KB |
-
arrayfunc.c
Submitted By: William Harrington (kb0iic at cross-lfs dot org) Date: 03-30-2014 Initial Package Version: 4.3 Origin: Upstream Upstream Status: Applied Description: Contains all upstream patches up to 4.3-011 diff -Naur bash-4.3.orig/arrayfunc.c bash-4.3/arrayfunc.c
old new 597 597 if (assoc_p (var)) 598 598 { 599 599 val = expand_assignment_string_to_string (val, 0); 600 if (val == 0) 601 { 602 val = (char *)xmalloc (1); 603 val[0] = '\0'; /* like do_assignment_internal */ 604 } 600 605 free_val = 1; 601 606 } 602 607 -
externs.h
diff -Naur bash-4.3.orig/externs.h bash-4.3/externs.h
old new 324 324 extern char *sh_backslash_quote __P((char *, const char *, int)); 325 325 extern char *sh_backslash_quote_for_double_quotes __P((char *)); 326 326 extern int sh_contains_shell_metas __P((char *)); 327 extern int sh_contains_quotes __P((char *)); 327 328 328 329 /* declarations for functions defined in lib/sh/spell.c */ 329 330 extern int spname __P((char *, char *)); -
bash-4.3
diff -Naur bash-4.3.orig/jobs.c bash-4.3/jobs.c
old new 4374 4374 void 4375 4375 end_job_control () 4376 4376 { 4377 if (interactive_shell ) /* XXX - should it be interactive? */4377 if (interactive_shell || job_control) /* XXX - should it be just job_control? */ 4378 4378 { 4379 4379 terminate_stopped_jobs (); 4380 4380 -
lib/glob/glob.c
diff -Naur bash-4.3.orig/lib/glob/glob.c bash-4.3/lib/glob/glob.c
old new 179 179 char *pat, *dname; 180 180 int flags; 181 181 { 182 char *pp, *pe, *t ;183 int n, r ;182 char *pp, *pe, *t, *se; 183 int n, r, negate; 184 184 185 negate = *pat == '!'; 185 186 pp = pat + 2; 186 pe = pp + strlen (pp) - 1; /*(*/ 187 if (*pe != ')') 188 return 0; 189 if ((t = strchr (pp, '|')) == 0) /* easy case first */ 187 se = pp + strlen (pp) - 1; /* end of string */ 188 pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ 189 /* we should check for invalid extglob pattern here */ 190 /* if pe != se we have more of the pattern at the end of the extglob 191 pattern. Check the easy case first ( */ 192 if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) 190 193 { 191 194 *pe = '\0'; 195 #if defined (HANDLE_MULTIBYTE) 196 r = mbskipname (pp, dname, flags); 197 #else 192 198 r = skipname (pp, dname, flags); /*(*/ 199 #endif 193 200 *pe = ')'; 194 201 return r; 195 202 } 203 204 /* check every subpattern */ 196 205 while (t = glob_patscan (pp, pe, '|')) 197 206 { 198 207 n = t[-1]; 199 208 t[-1] = '\0'; 209 #if defined (HANDLE_MULTIBYTE) 210 r = mbskipname (pp, dname, flags); 211 #else 200 212 r = skipname (pp, dname, flags); 213 #endif 201 214 t[-1] = n; 202 215 if (r == 0) /* if any pattern says not skip, we don't skip */ 203 216 return r; 204 217 pp = t; 205 218 } /*(*/ 206 219 207 if (pp == pe) /* glob_patscan might find end of pattern */ 220 /* glob_patscan might find end of pattern */ 221 if (pp == se) 208 222 return r; 209 223 210 *pe = '\0'; 211 # if defined (HANDLE_MULTIBYTE) 212 r = mbskipname (pp, dname, flags); /*(*/ 213 # else 214 r = skipname (pp, dname, flags); /*(*/ 215 # endif 216 *pe = ')'; 217 return r; 224 /* but if it doesn't then we didn't match a leading dot */ 225 return 0; 218 226 } 219 227 #endif 220 228 … … 277 285 int flags; 278 286 { 279 287 #if EXTENDED_GLOB 280 wchar_t *pp, *pe, *t, n ;281 int r ;288 wchar_t *pp, *pe, *t, n, *se; 289 int r, negate; 282 290 291 negate = *pat == L'!'; 283 292 pp = pat + 2; 284 pe = pp + wcslen (pp) - 1; /*(*/285 if (*pe != L')')286 return 0; 287 if ( (t = wcschr (pp, L'|')) == 0)293 se = pp + wcslen (pp) - 1; /*(*/ 294 pe = glob_patscan_wc (pp, se, 0); 295 296 if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0) 288 297 { 289 298 *pe = L'\0'; 290 299 r = wchkname (pp, dname); /*(*/ 291 300 *pe = L')'; 292 301 return r; 293 302 } 303 304 /* check every subpattern */ 294 305 while (t = glob_patscan_wc (pp, pe, '|')) 295 306 { 296 307 n = t[-1]; … … 305 316 if (pp == pe) /* glob_patscan_wc might find end of pattern */ 306 317 return r; 307 318 308 *pe = L'\0'; 309 r = wchkname (pp, dname); /*(*/ 310 *pe = L')'; 311 return r; 319 /* but if it doesn't then we didn't match a leading dot */ 320 return 0; 312 321 #else 313 322 return (wchkname (pat, dname)); 314 323 #endif -
lib/glob/gmisc.c
diff -Naur bash-4.3.orig/lib/glob/gmisc.c bash-4.3/lib/glob/gmisc.c
old new 210 210 case '+': 211 211 case '!': 212 212 case '@': 213 case '?': 213 214 return (pat[1] == LPAREN); 214 215 default: 215 216 return 0; -
lib/readline/display.c
diff -Naur bash-4.3.orig/lib/readline/display.c bash-4.3/lib/readline/display.c
old new 2677 2677 { 2678 2678 if (_rl_echoing_p) 2679 2679 { 2680 _rl_move_vert (_rl_vis_botlin); 2680 if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */ 2681 _rl_move_vert (_rl_vis_botlin); 2681 2682 _rl_vis_botlin = 0; 2682 2683 fflush (rl_outstream); 2683 2684 rl_restart_output (1, 0); -
lib/readline/readline.c
diff -Naur bash-4.3.orig/lib/readline/readline.c bash-4.3/lib/readline/readline.c
old new 744 744 r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); 745 745 746 746 RL_CHECK_SIGNALS (); 747 if (r == 0) /* success! */ 747 /* We only treat values < 0 specially to simulate recursion. */ 748 if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ 748 749 { 749 750 _rl_keyseq_chain_dispose (); 750 751 RL_UNSETSTATE (RL_STATE_MULTIKEY); … … 964 965 #if defined (VI_MODE) 965 966 if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && 966 967 key != ANYOTHERKEY && 967 rl_key_sequence_length == 1 && /* XXX */968 _rl_dispatching_keymap == vi_movement_keymap && 968 969 _rl_vi_textmod_command (key)) 969 970 _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); 970 971 #endif -
lib/sh/shquote.c
diff -Naur bash-4.3.orig/lib/sh/shquote.c bash-4.3/lib/sh/shquote.c
old new 311 311 312 312 return (0); 313 313 } 314 315 int 316 sh_contains_quotes (string) 317 char *string; 318 { 319 char *s; 320 321 for (s = string; s && *s; s++) 322 { 323 if (*s == '\'' || *s == '"' || *s == '\\') 324 return 1; 325 } 326 return 0; 327 } -
parse.y
diff -Naur bash-4.3.orig/parse.y bash-4.3/parse.y
old new 2424 2424 not already end in an EOF character. */ 2425 2425 if (shell_input_line_terminator != EOF) 2426 2426 { 2427 if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)2427 if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) 2428 2428 shell_input_line = (char *)xrealloc (shell_input_line, 2429 2429 1 + (shell_input_line_size += 2)); 2430 2430 … … 3398 3398 within a double-quoted ${...} construct "an even number of 3399 3399 unescaped double-quotes or single-quotes, if any, shall occur." */ 3400 3400 /* This was changed in Austin Group Interp 221 */ 3401 if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')3401 if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') 3402 3402 continue; 3403 3403 3404 3404 /* Could also check open == '`' if we want to parse grouping constructs -
patchlevel.h
diff -Naur bash-4.3.orig/patchlevel.h bash-4.3/patchlevel.h
old new 25 25 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh 26 26 looks for to find the patch level (for the sccs version string). */ 27 27 28 #define PATCHLEVEL 028 #define PATCHLEVEL 11 29 29 30 30 #endif /* _PATCHLEVEL_H_ */ -
pcomplete.c
diff -Naur bash-4.3.orig/pcomplete.c bash-4.3/pcomplete.c
old new 183 183 184 184 COMPSPEC *pcomp_curcs; 185 185 const char *pcomp_curcmd; 186 const char *pcomp_curtxt; 186 187 187 188 #ifdef DEBUG 188 189 /* Debugging code */ … … 753 754 quoted strings. */ 754 755 dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); 755 756 } 757 /* Intended to solve a mismatched assumption by bash-completion. If 758 the text to be completed is empty, but bash-completion turns it into 759 a quoted string ('') assuming that this code will dequote it before 760 calling readline, do the dequoting. */ 761 else if (iscompgen && iscompleting && 762 pcomp_curtxt && *pcomp_curtxt == 0 && 763 text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && 764 rl_filename_dequoting_function) 765 dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); 766 /* Another mismatched assumption by bash-completion. If compgen is being 767 run as part of bash-completion, and the argument to compgen is not 768 the same as the word originally passed to the programmable completion 769 code, dequote the argument if it has quote characters. It's an 770 attempt to detect when bash-completion is quoting its filename 771 argument before calling compgen. */ 772 /* We could check whether gen_shell_function_matches is in the call 773 stack by checking whether the gen-shell-function-matches tag is in 774 the unwind-protect stack, but there's no function to do that yet. 775 We could simply check whether we're executing in a function by 776 checking variable_context, and may end up doing that. */ 777 else if (iscompgen && iscompleting && rl_filename_dequoting_function && 778 pcomp_curtxt && text && 779 STREQ (pcomp_curtxt, text) == 0 && 780 variable_context && 781 sh_contains_quotes (text)) /* guess */ 782 dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); 756 783 else 757 784 dfn = savestring (text); 758 785 } … … 1522 1549 COMPSPEC **lastcs; 1523 1550 { 1524 1551 COMPSPEC *cs, *oldcs; 1525 const char *oldcmd ;1552 const char *oldcmd, *oldtxt; 1526 1553 STRINGLIST *ret; 1527 1554 1528 1555 cs = progcomp_search (ocmd); … … 1545 1572 1546 1573 oldcs = pcomp_curcs; 1547 1574 oldcmd = pcomp_curcmd; 1575 oldtxt = pcomp_curtxt; 1548 1576 1549 1577 pcomp_curcs = cs; 1550 1578 pcomp_curcmd = cmd; 1579 pcomp_curtxt = word; 1551 1580 1552 1581 ret = gen_compspec_completions (cs, cmd, word, start, end, foundp); 1553 1582 1554 1583 pcomp_curcs = oldcs; 1555 1584 pcomp_curcmd = oldcmd; 1585 pcomp_curtxt = oldtxt; 1556 1586 1557 1587 /* We need to conditionally handle setting *retryp here */ 1558 1588 if (retryp) -
bash-4.3
diff -Naur bash-4.3.orig/test.c bash-4.3/test.c
old new 646 646 return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE); 647 647 648 648 case 'R': 649 v = find_variable (arg);650 return ( v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);649 v = find_variable_noref (arg); 650 return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE); 651 651 } 652 652 653 653 /* We can't actually get here, but this shuts up gcc. */ … … 723 723 case 'o': case 'p': case 'r': case 's': case 't': 724 724 case 'u': case 'v': case 'w': case 'x': case 'z': 725 725 case 'G': case 'L': case 'O': case 'S': case 'N': 726 case 'R': 726 727 return (1); 727 728 } 728 729 -
bash-4.3
diff -Naur bash-4.3.orig/trap.c bash-4.3/trap.c
old new 920 920 subst_assign_varlist = 0; 921 921 922 922 #if defined (JOB_CONTROL) 923 save_pipeline (1); /* XXX only provides one save level */ 923 if (sig != DEBUG_TRAP) /* run_debug_trap does this */ 924 save_pipeline (1); /* XXX only provides one save level */ 924 925 #endif 925 926 926 927 /* If we're in a function, make sure return longjmps come here, too. */ … … 940 941 trap_exit_value = last_command_exit_value; 941 942 942 943 #if defined (JOB_CONTROL) 943 restore_pipeline (1); 944 if (sig != DEBUG_TRAP) /* run_debug_trap does this */ 945 restore_pipeline (1); 944 946 #endif 945 947 946 948 subst_assign_varlist = save_subst_varlist; -
y.tab.c
diff -Naur bash-4.3.orig/y.tab.c bash-4.3/y.tab.c
old new 4736 4736 not already end in an EOF character. */ 4737 4737 if (shell_input_line_terminator != EOF) 4738 4738 { 4739 if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)4739 if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) 4740 4740 shell_input_line = (char *)xrealloc (shell_input_line, 4741 4741 1 + (shell_input_line_size += 2)); 4742 4742 … … 5710 5710 within a double-quoted ${...} construct "an even number of 5711 5711 unescaped double-quotes or single-quotes, if any, shall occur." */ 5712 5712 /* This was changed in Austin Group Interp 221 */ 5713 if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')5713 if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') 5714 5714 continue; 5715 5715 5716 5716 /* Could also check open == '`' if we want to parse grouping constructs
Note:
See TracBrowser
for help on using the repository browser.