source: patches/bash-4.2-branch_update-3.patch @ 57b3f19

clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 57b3f19 was d01d386, checked in by Jonathan Norman <jon@…>, 12 years ago

Updated Bash update to -3

  • Property mode set to 100644
File size: 22.3 KB
  • assoc.c

    Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk)
    Date: 15-02-2012
    Initial Package Version: 4.2
    Origin: Upstream
    Upstream Status: Applied
    Description: Contains all upstream patches up to 4.2-020
    
    diff -Naur bash-4.2.orig/assoc.c bash-4.2/assoc.c
    old new  
    7777  b = hash_search (key, hash, HASH_CREATE);
    7878  if (b == 0)
    7979    return -1;
     80  /* If we are overwriting an existing element's value, we're not going to
     81     use the key.  Nothing in the array assignment code path frees the key
     82     string, so we can free it here to avoid a memory leak. */
     83  if (b->key != key)
     84    free (key);
    8085  FREE (b->data);
    8186  b->data = value ? savestring (value) : (char *)0;
    8287  return (0);
  • builtins/declare.def

    diff -Naur bash-4.2.orig/builtins/declare.def bash-4.2/builtins/declare.def
    old new  
    513513              *subscript_start = '[';   /* ] */
    514514              var = assign_array_element (name, value, 0);      /* XXX - not aflags */
    515515              *subscript_start = '\0';
     516              if (var == 0)     /* some kind of assignment error */
     517                {
     518                  assign_error++;
     519                  NEXT_VARIABLE ();
     520                }
    516521            }
    517522          else if (simple_array_assign)
    518523            {
  • builtins/fc.def

    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);
  • builtins/read.def

    diff -Naur bash-4.2.orig/builtins/read.def bash-4.2/builtins/read.def
    old new  
    642642          xfree (input_string);
    643643          return EXECUTION_FAILURE;     /* readonly or noassign */
    644644        }
     645      if (assoc_p (var))
     646        {
     647          builtin_error (_("%s: cannot convert associative to indexed array"), arrayname);
     648          xfree (input_string);
     649          return EXECUTION_FAILURE;     /* existing associative array */
     650        }
    645651      array_flush (array_cell (var));
    646652
    647653      alist = list_string (input_string, ifs_chars, 0);
  • execute_cmd.c

    diff -Naur bash-4.2.orig/execute_cmd.c bash-4.2/execute_cmd.c
    old new  
    21962196  if (ignore_return && cmd)
    21972197    cmd->flags |= CMD_IGNORE_RETURN;
    21982198
     2199#if defined (JOB_CONTROL)
    21992200  lastpipe_flag = 0;
    22002201  begin_unwind_frame ("lastpipe-exec");
    22012202  lstdin = -1;
     
    22152216          lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL);    /* XXX */
    22162217          add_unwind_protect (lastpipe_cleanup, lastpipe_jid);
    22172218        }
    2218       cmd->flags |= CMD_LASTPIPE;
     2219      if (cmd)
     2220        cmd->flags |= CMD_LASTPIPE;
    22192221    }     
    22202222  if (prev >= 0)
    22212223    add_unwind_protect (close, prev);
     2224#endif
    22222225
    22232226  exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close);
    22242227
     2228#if defined (JOB_CONTROL)
    22252229  if (lstdin > 0)
    22262230    restore_stdin (lstdin);
     2231#endif
    22272232
    22282233  if (prev >= 0)
    22292234    close (prev);
  • bash-4.2

    diff -Naur bash-4.2.orig/expr.c bash-4.2/expr.c
    old new  
    476476
    477477      if (special)
    478478        {
     479          if ((op == DIV || op == MOD) && value == 0)
     480            {
     481              if (noeval == 0)
     482                evalerror (_("division by 0"));
     483              else
     484                value = 1;
     485            }
     486
    479487          switch (op)
    480488            {
    481489            case MUL:
    482490              lvalue *= value;
    483491              break;
    484492            case DIV:
    485               if (value == 0)
    486                 evalerror (_("division by 0"));
    487493              lvalue /= value;
    488494              break;
    489495            case MOD:
    490               if (value == 0)
    491                 evalerror (_("division by 0"));
    492496              lvalue %= value;
    493497              break;
    494498            case PLUS:
     
    804808      val2 = exppower ();
    805809
    806810      if (((op == DIV) || (op == MOD)) && (val2 == 0))
    807         evalerror (_("division by 0"));
     811        {
     812          if (noeval == 0)
     813            evalerror (_("division by 0"));
     814          else
     815            val2 = 1;
     816        }
    808817
    809818      if (op == MUL)
    810819        val1 *= val2;
  • 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  
    24992499         We do this only if it is time to do so. Notice that only here
    25002500         is the mail alarm reset; nothing takes place in check_mail ()
    25012501         except the checking of mail.  Please don't change this. */
    2502       if (prompt_is_ps1 && time_to_check_mail ())
     2502      if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ())
    25032503        {
    25042504          check_mail ();
    25052505          reset_mail_timer ();
     
    38423842     int flags;
    38433843{
    38443844  sh_parser_state_t ps;
     3845  sh_input_line_state_t ls;
    38453846  int orig_ind, nc, sflags;
    38463847  char *ret, *s, *ep, *ostring;
    38473848
     
    38493850  orig_ind = *indp;
    38503851  ostring = string;
    38513852
     3853/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/
    38523854  sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE;
    38533855  if (flags & SX_NOLONGJMP)
    38543856    sflags |= SEVAL_NOLONGJMP;
    38553857  save_parser_state (&ps);
     3858  save_input_line_state (&ls);
    38563859
    38573860  /*(*/
    38583861  parser_state |= PST_CMDSUBST|PST_EOFTOKEN;    /* allow instant ')' */ /*(*/
     
    38613864
    38623865  restore_parser_state (&ps);
    38633866  reset_parser ();
     3867  /* reset_parser clears shell_input_line and associated variables */
     3868  restore_input_line_state (&ls);
    38643869  if (interactive)
    38653870    token_to_read = 0;
    38663871
     
    51355140            case 'A':
    51365141              /* Make the current time/date into a string. */
    51375142              (void) time (&the_time);
     5143#if defined (HAVE_TZSET)
     5144              sv_tz ("TZ");             /* XXX -- just make sure */
     5145#endif
    51385146              tm = localtime (&the_time);
    51395147
    51405148              if (c == 'd')
     
    59055913  ps->expand_aliases = expand_aliases;
    59065914  ps->echo_input_at_read = echo_input_at_read;
    59075915
     5916  ps->token = token;
     5917  ps->token_buffer_size = token_buffer_size;
     5918  /* Force reallocation on next call to read_token_word */
     5919  token = 0;
     5920  token_buffer_size = 0;
     5921
    59085922  return (ps);
    59095923}
    59105924
     
    59465960
    59475961  expand_aliases = ps->expand_aliases;
    59485962  echo_input_at_read = ps->echo_input_at_read;
     5963
     5964  FREE (token);
     5965  token = ps->token;
     5966  token_buffer_size = ps->token_buffer_size;
     5967}
     5968
     5969sh_input_line_state_t *
     5970save_input_line_state (ls)
     5971     sh_input_line_state_t *ls;
     5972{
     5973  if (ls == 0)
     5974    ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t));
     5975  if (ls == 0)
     5976    return ((sh_input_line_state_t *)NULL);
     5977
     5978  ls->input_line = shell_input_line;
     5979  ls->input_line_size = shell_input_line_size;
     5980  ls->input_line_len = shell_input_line_len;
     5981  ls->input_line_index = shell_input_line_index;
     5982
     5983  /* force reallocation */
     5984  shell_input_line = 0;
     5985  shell_input_line_size = shell_input_line_len = shell_input_line_index = 0;
     5986}
     5987
     5988void
     5989restore_input_line_state (ls)
     5990     sh_input_line_state_t *ls;
     5991{
     5992  FREE (shell_input_line);
     5993  shell_input_line = ls->input_line;
     5994  shell_input_line_size = ls->input_line_size;
     5995  shell_input_line_len = ls->input_line_len;
     5996  shell_input_line_index = ls->input_line_index;
     5997
     5998  set_line_mbstate ();
    59495999}
    59506000
    59516001/************************************************
  • 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 20
    2929
    3030#endif /* _PATCHLEVEL_H_ */
  • pathexp.c

    diff -Naur bash-4.2.orig/pathexp.c bash-4.2/pathexp.c
    old new  
    196196        {
    197197          if ((qflags & QGLOB_FILENAME) && pathname[i+1] == '/')
    198198            continue;
    199           if ((qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0)
     199          if (pathname[i+1] != CTLESC && (qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0)
    200200            continue;
    201201          temp[j++] = '\\';
    202202          i++;
  • 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    {
  • shell.h

    diff -Naur bash-4.2.orig/shell.h bash-4.2/shell.h
    old new  
    136136  int parser_state;
    137137  int *token_state;
    138138
     139  char *token;
     140  int token_buffer_size;
     141
    139142  /* input line state -- line number saved elsewhere */
    140143  int input_line_terminator;
    141144  int eof_encountered;
     
    166169 
    167170} sh_parser_state_t;
    168171
     172typedef struct _sh_input_line_state_t {
     173  char *input_line;
     174  int input_line_index;
     175  int input_line_size;
     176  int input_line_len;
     177} sh_input_line_state_t;
     178
    169179/* Let's try declaring these here. */
    170180extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *));
    171181extern void restore_parser_state __P((sh_parser_state_t *));
     182
     183extern sh_input_line_state_t *save_input_line_state __P((sh_input_line_state_t *));
     184extern void restore_input_line_state __P((sh_input_line_state_t *));
  • 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);
     
    37043706            break;
    37053707        }
    37063708      else if (string[i] == CTLNUL)
    3707         i++;
     3709        {
     3710          i++;
     3711          continue;
     3712        }
    37083713
    37093714      prev_i = i;
    37103715      ADVANCE_CHAR (string, slen, i);
     
    46074612  if (ifs_firstc == 0)
    46084613#endif
    46094614    word->flags |= W_NOSPLIT;
     4615  word->flags |= W_NOSPLIT2;
    46104616  result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL);
    46114617  expand_no_split_dollar_star = 0;
    46124618
     
    71767182    {
    71777183      /* Extract the contents of the ${ ... } expansion
    71787184         according to the Posix.2 rules. */
    7179       value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#') ? SX_POSIXEXP : 0);
     7185      value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD);
    71807186      if (string[sindex] == RBRACE)
    71817187        sindex++;
    71827188      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. */
  • support/shobj-conf

    diff -Naur bash-4.2.orig/support/shobj-conf bash-4.2/support/shobj-conf
    old new  
    157157        ;;
    158158
    159159# Darwin/MacOS X
    160 darwin[89]*|darwin10*)
     160darwin[89]*|darwin1[012]*)
    161161        SHOBJ_STATUS=supported
    162162        SHLIB_STATUS=supported
    163163       
     
    186186        SHLIB_LIBSUFF='dylib'
    187187
    188188        case "${host_os}" in
    189         darwin[789]*|darwin10*) SHOBJ_LDFLAGS=''
     189        darwin[789]*|darwin1[012]*)     SHOBJ_LDFLAGS=''
    190190                        SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
    191191                        ;;
    192192        *)              SHOBJ_LDFLAGS='-dynamic'
  • 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.