source: patches/bash-4.3-branch_update-2.patch@ bc19d65

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since bc19d65 was 94a653a, checked in by William Harrington <kb0iic@…>, 11 years ago

Add bash 4.3 branch update 2 patch for level 11.

  • Property mode set to 100644
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  
    597597      if (assoc_p (var))
    598598        {
    599599          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            }
    600605          free_val = 1;
    601606        }
    602607
  • externs.h

    diff -Naur bash-4.3.orig/externs.h bash-4.3/externs.h
    old new  
    324324extern char *sh_backslash_quote __P((char *, const char *, int));
    325325extern char *sh_backslash_quote_for_double_quotes __P((char *));
    326326extern int sh_contains_shell_metas __P((char *));
     327extern int sh_contains_quotes __P((char *));
    327328
    328329/* declarations for functions defined in lib/sh/spell.c */
    329330extern int spname __P((char *, char *));
  • bash-4.3

    diff -Naur bash-4.3.orig/jobs.c bash-4.3/jobs.c
    old new  
    43744374void
    43754375end_job_control ()
    43764376{
    4377   if (interactive_shell)                /* XXX - should it be interactive? */
     4377  if (interactive_shell || job_control)         /* XXX - should it be just job_control? */
    43784378    {
    43794379      terminate_stopped_jobs ();
    43804380
  • lib/glob/glob.c

    diff -Naur bash-4.3.orig/lib/glob/glob.c bash-4.3/lib/glob/glob.c
    old new  
    179179     char *pat, *dname;
    180180     int flags;
    181181{
    182   char *pp, *pe, *t;
    183   int n, r;
     182  char *pp, *pe, *t, *se;
     183  int n, r, negate;
    184184
     185  negate = *pat == '!';
    185186  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)
    190193    {
    191194      *pe = '\0';
     195#if defined (HANDLE_MULTIBYTE)
     196      r = mbskipname (pp, dname, flags);
     197#else
    192198      r = skipname (pp, dname, flags);  /*(*/
     199#endif
    193200      *pe = ')';
    194201      return r;
    195202    }
     203
     204  /* check every subpattern */
    196205  while (t = glob_patscan (pp, pe, '|'))
    197206    {
    198207      n = t[-1];
    199208      t[-1] = '\0';
     209#if defined (HANDLE_MULTIBYTE)
     210      r = mbskipname (pp, dname, flags);
     211#else
    200212      r = skipname (pp, dname, flags);
     213#endif
    201214      t[-1] = n;
    202215      if (r == 0)       /* if any pattern says not skip, we don't skip */
    203216        return r;
    204217      pp = t;
    205218    }   /*(*/
    206219
    207   if (pp == pe)         /* glob_patscan might find end of pattern */
     220  /* glob_patscan might find end of pattern */
     221  if (pp == se)
    208222    return r;
    209223
    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;
    218226}
    219227#endif
    220228
     
    277285     int flags;
    278286{
    279287#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;
    282290
     291  negate = *pat == L'!';
    283292  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)
    288297    {
    289298      *pe = L'\0';
    290299      r = wchkname (pp, dname); /*(*/
    291300      *pe = L')';
    292301      return r;
    293302    }
     303
     304  /* check every subpattern */
    294305  while (t = glob_patscan_wc (pp, pe, '|'))
    295306    {
    296307      n = t[-1];
     
    305316  if (pp == pe)         /* glob_patscan_wc might find end of pattern */
    306317    return r;
    307318
    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;
    312321#else
    313322  return (wchkname (pat, dname));
    314323#endif
  • lib/glob/gmisc.c

    diff -Naur bash-4.3.orig/lib/glob/gmisc.c bash-4.3/lib/glob/gmisc.c
    old new  
    210210    case '+':
    211211    case '!':
    212212    case '@':
     213    case '?':
    213214      return (pat[1] == LPAREN);
    214215    default:
    215216      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  
    26772677{
    26782678  if (_rl_echoing_p)
    26792679    {
    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);
    26812682      _rl_vis_botlin = 0;
    26822683      fflush (rl_outstream);
    26832684      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  
    744744    r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
    745745
    746746  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! */
    748749    {
    749750      _rl_keyseq_chain_dispose ();
    750751      RL_UNSETSTATE (RL_STATE_MULTIKEY);
     
    964965#if defined (VI_MODE)
    965966  if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
    966967      key != ANYOTHERKEY &&
    967       rl_key_sequence_length == 1 &&    /* XXX */
     968      _rl_dispatching_keymap == vi_movement_keymap &&
    968969      _rl_vi_textmod_command (key))
    969970    _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
    970971#endif
  • lib/sh/shquote.c

    diff -Naur bash-4.3.orig/lib/sh/shquote.c bash-4.3/lib/sh/shquote.c
    old new  
    311311
    312312  return (0);
    313313}
     314
     315int
     316sh_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  
    24242424         not already end in an EOF character.  */
    24252425      if (shell_input_line_terminator != EOF)
    24262426        {
    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))
    24282428            shell_input_line = (char *)xrealloc (shell_input_line,
    24292429                                        1 + (shell_input_line_size += 2));
    24302430
     
    33983398         within a double-quoted ${...} construct "an even number of
    33993399         unescaped double-quotes or single-quotes, if any, shall occur." */
    34003400      /* 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 == '\'')
    34023402        continue;
    34033403
    34043404      /* 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  
    2525   regexp `^#define[    ]*PATCHLEVEL', since that's what support/mkversion.sh
    2626   looks for to find the patch level (for the sccs version string). */
    2727
    28 #define PATCHLEVEL 0
     28#define PATCHLEVEL 11
    2929
    3030#endif /* _PATCHLEVEL_H_ */
  • pcomplete.c

    diff -Naur bash-4.3.orig/pcomplete.c bash-4.3/pcomplete.c
    old new  
    183183
    184184COMPSPEC *pcomp_curcs;
    185185const char *pcomp_curcmd;
     186const char *pcomp_curtxt;
    186187
    187188#ifdef DEBUG
    188189/* Debugging code */
     
    753754             quoted strings. */
    754755          dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
    755756        }
     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);
    756783      else
    757784        dfn = savestring (text);
    758785    }
     
    15221549     COMPSPEC **lastcs;
    15231550{
    15241551  COMPSPEC *cs, *oldcs;
    1525   const char *oldcmd;
     1552  const char *oldcmd, *oldtxt;
    15261553  STRINGLIST *ret;
    15271554
    15281555  cs = progcomp_search (ocmd);
     
    15451572
    15461573  oldcs = pcomp_curcs;
    15471574  oldcmd = pcomp_curcmd;
     1575  oldtxt = pcomp_curtxt;
    15481576
    15491577  pcomp_curcs = cs;
    15501578  pcomp_curcmd = cmd;
     1579  pcomp_curtxt = word;
    15511580
    15521581  ret = gen_compspec_completions (cs, cmd, word, start, end, foundp);
    15531582
    15541583  pcomp_curcs = oldcs;
    15551584  pcomp_curcmd = oldcmd;
     1585  pcomp_curtxt = oldtxt;
    15561586
    15571587  /* We need to conditionally handle setting *retryp here */
    15581588  if (retryp)
  • bash-4.3

    diff -Naur bash-4.3.orig/test.c bash-4.3/test.c
    old new  
    646646      return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE);
    647647
    648648    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);
    651651    }
    652652
    653653  /* We can't actually get here, but this shuts up gcc. */
     
    723723    case 'o': case 'p': case 'r': case 's': case 't':
    724724    case 'u': case 'v': case 'w': case 'x': case 'z':
    725725    case 'G': case 'L': case 'O': case 'S': case 'N':
     726    case 'R':
    726727      return (1);
    727728    }
    728729
  • bash-4.3

    diff -Naur bash-4.3.orig/trap.c bash-4.3/trap.c
    old new  
    920920      subst_assign_varlist = 0;
    921921
    922922#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 */
    924925#endif
    925926
    926927      /* If we're in a function, make sure return longjmps come here, too. */
     
    940941      trap_exit_value = last_command_exit_value;
    941942
    942943#if defined (JOB_CONTROL)
    943       restore_pipeline (1);
     944      if (sig != DEBUG_TRAP)    /* run_debug_trap does this */
     945        restore_pipeline (1);
    944946#endif
    945947
    946948      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  
    47364736         not already end in an EOF character.  */
    47374737      if (shell_input_line_terminator != EOF)
    47384738        {
    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))
    47404740            shell_input_line = (char *)xrealloc (shell_input_line,
    47414741                                        1 + (shell_input_line_size += 2));
    47424742
     
    57105710         within a double-quoted ${...} construct "an even number of
    57115711         unescaped double-quotes or single-quotes, if any, shall occur." */
    57125712      /* 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 == '\'')
    57145714        continue;
    57155715
    57165716      /* Could also check open == '`' if we want to parse grouping constructs
Note: See TracBrowser for help on using the repository browser.