source: patches/bash-4.2-branch_update-2.patch @ 279277d

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 279277d was b369f3c, checked in by Jonathan Norman <jon@…>, 13 years ago

Add GCC branch update, Updated ncurses, vim, bash and tar patches

  • Property mode set to 100644
File size: 13.8 KB
  • builtins/fc.def

    Submitted By: Jonathan Norman (jonathan at bluesquarelinux.co.uk)
    Date: 2011-05-16
    Initial Package Version: 4.2
    Origin: Upstream
    Upstream Status: Applied
    Description: Contains all upstream patches up to 4.2-010
    
    diff -Naur bash-4.2.orig/builtins/fc.def bash-4.2/builtins/fc.def
    old new  
    304304  last_hist = i - rh - hist_last_line_added;
    305305
    306306  /* XXX */
    307   if (saved_command_line_count > 0 && i == last_hist && hlist[last_hist] == 0)
     307  if (i == last_hist && hlist[last_hist] == 0)
    308308    while (last_hist >= 0 && hlist[last_hist] == 0)
    309309      last_hist--;
    310310  if (last_hist < 0)
     
    475475     HIST_ENTRY **hlist;
    476476{
    477477  int sign, n, clen, rh;
    478   register int i, j;
     478  register int i, j, last_hist;
    479479  register char *s;
    480480
    481481  sign = 1;
     
    495495     has been enabled (interactive or not) should use it in the last_hist
    496496     calculation as if it were on. */
    497497  rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
    498   i -= rh + hist_last_line_added;
     498  last_hist = i - rh - hist_last_line_added;
     499
     500  if (i == last_hist && hlist[last_hist] == 0)
     501    while (last_hist >= 0 && hlist[last_hist] == 0)
     502      last_hist--;
     503  if (last_hist < 0)
     504    return (-1);
     505
     506  i = last_hist;
    499507
    500508  /* No specification defaults to most recent command. */
    501509  if (command == NULL)
  • builtins/printf.def

    diff -Naur bash-4.2.orig/builtins/printf.def bash-4.2/builtins/printf.def
    old new  
    465465                  secs = shell_start_time;      /* roughly $SECONDS */
    466466                else
    467467                  secs = arg;
     468#if defined (HAVE_TZSET)
     469                sv_tz ("TZ");           /* XXX -- just make sure */
     470#endif
    468471                tm = localtime (&secs);
    469472                n = strftime (timebuf, sizeof (timebuf), timefmt, tm);
    470473                free (timefmt);
  • lib/glob/gmisc.c

    diff -Naur bash-4.2.orig/lib/glob/gmisc.c bash-4.2/lib/glob/gmisc.c
    old new  
    7777     wchar_t *wpat;
    7878     size_t wmax;
    7979{
    80   wchar_t wc, *wbrack;
    81   int matlen, t, in_cclass, in_collsym, in_equiv;
     80  wchar_t wc;
     81  int matlen, bracklen, t, in_cclass, in_collsym, in_equiv;
    8282
    8383  if (*wpat == 0)
    8484    return (0);
     
    118118          break;
    119119        case L'[':
    120120          /* scan for ending `]', skipping over embedded [:...:] */
    121           wbrack = wpat;
     121          bracklen = 1;
    122122          wc = *wpat++;
    123123          do
    124124            {
    125125              if (wc == 0)
    126126                {
    127                   matlen += wpat - wbrack - 1;  /* incremented below */
    128                   break;
     127                  wpat--;                       /* back up to NUL */
     128                  matlen += bracklen;
     129                  goto bad_bracket;
    129130                }
    130131              else if (wc == L'\\')
    131132                {
    132                   wc = *wpat++;
    133                   if (*wpat == 0)
    134                     break;
     133                  /* *wpat == backslash-escaped character */
     134                  bracklen++;
     135                  /* If the backslash or backslash-escape ends the string,
     136                     bail.  The ++wpat skips over the backslash escape */
     137                  if (*wpat == 0 || *++wpat == 0)
     138                    {
     139                      matlen += bracklen;
     140                      goto bad_bracket;
     141                    }
    135142                }
    136143              else if (wc == L'[' && *wpat == L':')     /* character class */
    137144                {
    138145                  wpat++;
     146                  bracklen++;
    139147                  in_cclass = 1;
    140148                }
    141149              else if (in_cclass && wc == L':' && *wpat == L']')
    142150                {
    143151                  wpat++;
     152                  bracklen++;
    144153                  in_cclass = 0;
    145154                }
    146155              else if (wc == L'[' && *wpat == L'.')     /* collating symbol */
    147156                {
    148157                  wpat++;
     158                  bracklen++;
    149159                  if (*wpat == L']')    /* right bracket can appear as collating symbol */
    150                     wpat++;
     160                    {
     161                      wpat++;
     162                      bracklen++;
     163                    }
    151164                  in_collsym = 1;
    152165                }
    153166              else if (in_collsym && wc == L'.' && *wpat == L']')
    154167                {
    155168                  wpat++;
     169                  bracklen++;
    156170                  in_collsym = 0;
    157171                }
    158172              else if (wc == L'[' && *wpat == L'=')     /* equivalence class */
    159173                {
    160174                  wpat++;
     175                  bracklen++;
    161176                  if (*wpat == L']')    /* right bracket can appear as equivalence class */
    162                     wpat++;
     177                    {
     178                      wpat++;
     179                      bracklen++;
     180                    }
    163181                  in_equiv = 1;
    164182                }
    165183              else if (in_equiv && wc == L'=' && *wpat == L']')
    166184                {
    167185                  wpat++;
     186                  bracklen++;
    168187                  in_equiv = 0;
    169188                }
     189              else
     190                bracklen++;
    170191            }
    171192          while ((wc = *wpat++) != L']');
    172193          matlen++;             /* bracket expression can only match one char */
     194bad_bracket:
    173195          break;
    174196        }
    175197    }
     
    213235     char *pat;
    214236     size_t max;
    215237{
    216   char c, *brack;
    217   int matlen, t, in_cclass, in_collsym, in_equiv;
     238  char c;
     239  int matlen, bracklen, t, in_cclass, in_collsym, in_equiv;
    218240
    219241  if (*pat == 0)
    220242    return (0);
     
    254276          break;
    255277        case '[':
    256278          /* scan for ending `]', skipping over embedded [:...:] */
    257           brack = pat;
     279          bracklen = 1;
    258280          c = *pat++;
    259281          do
    260282            {
    261283              if (c == 0)
    262284                {
    263                   matlen += pat - brack - 1;    /* incremented below */
    264                   break;
     285                  pat--;                        /* back up to NUL */
     286                  matlen += bracklen;
     287                  goto bad_bracket;
    265288                }
    266289              else if (c == '\\')
    267290                {
    268                   c = *pat++;
    269                   if (*pat == 0)
    270                     break;
     291                  /* *pat == backslash-escaped character */
     292                  bracklen++;
     293                  /* If the backslash or backslash-escape ends the string,
     294                     bail.  The ++pat skips over the backslash escape */
     295                  if (*pat == 0 || *++pat == 0)
     296                    {
     297                      matlen += bracklen;
     298                      goto bad_bracket;
     299                    }
    271300                }
    272301              else if (c == '[' && *pat == ':') /* character class */
    273302                {
    274303                  pat++;
     304                  bracklen++;
    275305                  in_cclass = 1;
    276306                }
    277307              else if (in_cclass && c == ':' && *pat == ']')
    278308                {
    279309                  pat++;
     310                  bracklen++;
    280311                  in_cclass = 0;
    281312                }
    282313              else if (c == '[' && *pat == '.') /* collating symbol */
    283314                {
    284315                  pat++;
     316                  bracklen++;
    285317                  if (*pat == ']')      /* right bracket can appear as collating symbol */
    286                     pat++;
     318                    {
     319                      pat++;
     320                      bracklen++;
     321                    }
    287322                  in_collsym = 1;
    288323                }
    289324              else if (in_collsym && c == '.' && *pat == ']')
    290325                {
    291326                  pat++;
     327                  bracklen++;
    292328                  in_collsym = 0;
    293329                }
    294330              else if (c == '[' && *pat == '=') /* equivalence class */
    295331                {
    296332                  pat++;
     333                  bracklen++;
    297334                  if (*pat == ']')      /* right bracket can appear as equivalence class */
    298                     pat++;
     335                    {
     336                      pat++;
     337                      bracklen++;
     338                    }
    299339                  in_equiv = 1;
    300340                }
    301341              else if (in_equiv && c == '=' && *pat == ']')
    302342                {
    303343                  pat++;
     344                  bracklen++;
    304345                  in_equiv = 0;
    305346                }
     347              else
     348                bracklen++;
    306349            }
    307350          while ((c = *pat++) != ']');
    308351          matlen++;             /* bracket expression can only match one char */
     352bad_bracket:
    309353          break;
    310354        }
    311355    }
  • lib/readline/callback.c

    diff -Naur bash-4.2.orig/lib/readline/callback.c bash-4.2/lib/readline/callback.c
    old new  
    148148          eof = _rl_vi_domove_callback (_rl_vimvcxt);
    149149          /* Should handle everything, including cleanup, numeric arguments,
    150150             and turning off RL_STATE_VIMOTION */
     151          if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)
     152            _rl_internal_char_cleanup ();
     153
    151154          return;
    152155        }
    153156#endif
  • lib/readline/vi_mode.c

    diff -Naur bash-4.2.orig/lib/readline/vi_mode.c bash-4.2/lib/readline/vi_mode.c
    old new  
    11141114      rl_beg_of_line (1, c);
    11151115      _rl_vi_last_motion = c;
    11161116      RL_UNSETSTATE (RL_STATE_VIMOTION);
    1117       return (0);
     1117      return (vidomove_dispatch (m));
    11181118    }
    11191119#if defined (READLINE_CALLBACKS)
    11201120  /* XXX - these need to handle rl_universal_argument bindings */
  • parse.y

    diff -Naur bash-4.2.orig/parse.y bash-4.2/parse.y
    old new  
    51355135            case 'A':
    51365136              /* Make the current time/date into a string. */
    51375137              (void) time (&the_time);
     5138#if defined (HAVE_TZSET)
     5139              sv_tz ("TZ");             /* XXX -- just make sure */
     5140#endif
    51385141              tm = localtime (&the_time);
    51395142
    51405143              if (c == 'd')
  • patchlevel.h

    diff -Naur bash-4.2.orig/patchlevel.h bash-4.2/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 10
    2929
    3030#endif /* _PATCHLEVEL_H_ */
  • print_cmd.c

    diff -Naur bash-4.2.orig/print_cmd.c bash-4.2/print_cmd.c
    old new  
    315315          cprintf ("( ");
    316316          skip_this_indent++;
    317317          make_command_string_internal (command->value.Subshell->command);
     318          PRINT_DEFERRED_HEREDOCS ("");
    318319          cprintf (" )");
    319320          break;
    320321
     
    592593  newline ("do\n");
    593594  indentation += indentation_amount;
    594595  make_command_string_internal (arith_for_command->action);
     596  PRINT_DEFERRED_HEREDOCS ("");
    595597  semicolon ();
    596598  indentation -= indentation_amount;
    597599  newline ("done");
     
    653655    }
    654656
    655657  make_command_string_internal (group_command->command);
     658  PRINT_DEFERRED_HEREDOCS ("");
    656659
    657660  if (inside_function_def)
    658661    {
  • bash-4.2

    diff -Naur bash-4.2.orig/sig.c bash-4.2/sig.c
    old new  
    4646
    4747#if defined (READLINE)
    4848#  include "bashline.h"
     49#  include <readline/readline.h>
    4950#endif
    5051
    5152#if defined (HISTORY)
     
    6263#if defined (HISTORY)
    6364extern int history_lines_this_session;
    6465#endif
     66extern int no_line_editing;
    6567
    6668extern void initialize_siglist ();
    6769
     
    505507    {
    506508#if defined (HISTORY)
    507509      /* XXX - will inhibit history file being written */
    508       history_lines_this_session = 0;
     510#  if defined (READLINE)
     511      if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0))
     512#  endif
     513        history_lines_this_session = 0;
    509514#endif
    510515      terminate_immediately = 0;
    511516      termsig_handler (sig);
  • subst.c

    diff -Naur bash-4.2.orig/subst.c bash-4.2/subst.c
    old new  
    13791379  slen = strlen (string + *sindex) + *sindex;
    13801380
    13811381  /* The handling of dolbrace_state needs to agree with the code in parse.y:
    1382      parse_matched_pair() */
    1383   dolbrace_state = 0;
    1384   if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
    1385     dolbrace_state = (flags & SX_POSIXEXP) ? DOLBRACE_QUOTE : DOLBRACE_PARAM;
     1382     parse_matched_pair().  The different initial value is to handle the
     1383     case where this function is called to parse the word in
     1384     ${param op word} (SX_WORD). */
     1385  dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM;
     1386  if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP))
     1387    dolbrace_state = DOLBRACE_QUOTE;
    13861388
    13871389  i = *sindex;
    13881390  while (c = string[i])
     
    33713373  if (string == 0 || *string == '\0')
    33723374    return (WORD_LIST *)NULL;
    33733375
    3374   td.flags = 0;
     3376  td.flags = W_NOSPLIT2;                /* no splitting, remove "" and '' */
    33753377  td.word = string;
    33763378  tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at);
    33773379  return (tresult);
     
    46074609  if (ifs_firstc == 0)
    46084610#endif
    46094611    word->flags |= W_NOSPLIT;
     4612  word->flags |= W_NOSPLIT2;
    46104613  result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL);
    46114614  expand_no_split_dollar_star = 0;
    46124615
     
    71767179    {
    71777180      /* Extract the contents of the ${ ... } expansion
    71787181         according to the Posix.2 rules. */
    7179       value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#') ? SX_POSIXEXP : 0);
     7182      value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD);
    71807183      if (string[sindex] == RBRACE)
    71817184        sindex++;
    71827185      else
  • subst.h

    diff -Naur bash-4.2.orig/subst.h bash-4.2/subst.h
    old new  
    5656#define SX_NOLONGJMP    0x0040  /* don't longjmp on fatal error */
    5757#define SX_ARITHSUB     0x0080  /* extracting $(( ... )) (currently unused) */
    5858#define SX_POSIXEXP     0x0100  /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */
     59#define SX_WORD         0x0200  /* extracting word in ${param op word} */
    5960
    6061/* Remove backslashes which are quoting backquotes from STRING.  Modifies
    6162   STRING, and returns a pointer to it. */
  • variables.c

    diff -Naur bash-4.2.orig/variables.c bash-4.2/variables.c
    old new  
    36533653  return n;
    36543654}
    36553655
     3656int
     3657chkexport (name)
     3658     char *name;
     3659{
     3660  SHELL_VAR *v;
     3661
     3662  v = find_variable (name);
     3663  if (v && exported_p (v))
     3664    {
     3665      array_needs_making = 1;
     3666      maybe_make_export_env ();
     3667      return 1;
     3668    }
     3669  return 0;
     3670}
     3671
    36563672void
    36573673maybe_make_export_env ()
    36583674{
     
    42144230  { "TEXTDOMAIN", sv_locale },
    42154231  { "TEXTDOMAINDIR", sv_locale },
    42164232
    4217 #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
     4233#if defined (HAVE_TZSET)
    42184234  { "TZ", sv_tz },
    42194235#endif
    42204236
     
    45584574}
    45594575#endif /* HISTORY */
    45604576
    4561 #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
     4577#if defined (HAVE_TZSET)
    45624578void
    45634579sv_tz (name)
    45644580     char *name;
    45654581{
    4566   tzset ();
     4582  if (chkexport (name))
     4583    tzset ();
    45674584}
    45684585#endif
    45694586
  • variables.h

    diff -Naur bash-4.2.orig/variables.h bash-4.2/variables.h
    old new  
    313313
    314314extern void sort_variables __P((SHELL_VAR **));
    315315
     316extern int chkexport __P((char *));
    316317extern void maybe_make_export_env __P((void));
    317318extern void update_export_env_inplace __P((char *, int, char *));
    318319extern void put_command_name_into_env __P((char *));
Note: See TracBrowser for help on using the repository browser.