source: patches/bash-3.1-fixes-7.patch@ 4af05f3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 4af05f3 was cf468ea, checked in by Jim Gifford <clfs@…>, 19 years ago

Updated to -7 bash patch

  • Property mode set to 100644
File size: 20.5 KB
  • doc/bash.1

    Submitted By: Jeremy Huntwork (jhuntwork at linuxfromscratch dot org)
    Date: 2006-04-11
    Initial Package Version: 3.1
    Origin: http://ftp.gnu.org/gnu/bash/bash-3.1-patches/
    Upstream Status: From Upstream
    Description: Contains patches 001-016 from upstream
    
    diff -Naur bash-3.1.orig/doc/bash.1 bash-3.1/doc/bash.1
    old new  
    66.\"     Case Western Reserve University
    77.\"     chet@po.cwru.edu
    88.\"
    9 .\"     Last Change: Sat Aug 27 13:28:44 EDT 2005
     9.\"     Last Change: Wed Dec 28 19:58:45 EST 2005
    1010.\"
    1111.\" bash_builtins, strip all but Built-Ins section
    1212.if \n(zZ=1 .ig zZ
    1313.if \n(zY=1 .ig zY
    14 .TH BASH 1 "2005 Aug 27" "GNU Bash-3.1-beta1"
     14.TH BASH 1 "2005 Dec 28" "GNU Bash-3.1"
    1515.\"
    1616.\" There's some problem with having a `@'
    1717.\" in a tagged paragraph with the BSD man macros.
     
    677677.B nocasematch
    678678is enabled, the match is performed without regard to the case
    679679of alphabetic characters.
    680 The return value is 0 if the string matches or does not match
    681 the pattern, respectively, and 1 otherwise.
     680The return value is 0 if the string matches (\fB==\fP) or does not match
     681(\fB!=\fP) the pattern, and 1 otherwise.
    682682Any part of the pattern may be quoted to force it to be matched as a
    683683string.
    684684.if t .sp 0.5
     
    807807as for pathname expansion (see
    808808.B Pathname Expansion
    809809below).
     810The \fIword\fP is expanded using tilde
     811expansion, parameter and variable expansion, arithmetic substituion,
     812command substitution, process substitution and quote removal.
     813Each \fIpattern\fP examined is expanded using tilde
     814expansion, parameter and variable expansion, arithmetic substituion,
     815command substitution, and process substitution.
    810816If the shell option
    811817.B nocasematch
    812818is enabled, the match is performed without regard to the case
     
    84848490returns true if any of the arguments are found, false if
    84858491none are found.
    84868492.TP
    8487 \fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]]
     8493\fBulimit\fP [\fB\-SHacdfilmnpqstuvx\fP [\fIlimit\fP]]
    84888494Provides control over the resources available to the shell and to
    84898495processes started by it, on systems that allow such control.
    84908496The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
     
    85238529.B \-f
    85248530The maximum size of files created by the shell
    85258531.TP
     8532.B \-i
     8533The maximum number of pending signals
     8534.TP
    85268535.B \-l
    85278536The maximum size that may be locked into memory
    85288537.TP
     
    85368545.B \-p
    85378546The pipe size in 512-byte blocks (this may not be set)
    85388547.TP
     8548.B \-q
     8549The maximum number of bytes in POSIX message queues
     8550.TP
    85398551.B \-s
    85408552The maximum stack size
    85418553.TP
     
    85478559.TP
    85488560.B \-v
    85498561The maximum amount of virtual memory available to the shell
     8562.TP
     8563.B \-x
     8564The maximum number of file locks
    85508565.PD
    85518566.PP
    85528567If
  • doc/bashref.texi

    diff -Naur bash-3.1.orig/doc/bashref.texi bash-3.1/doc/bashref.texi
    old new  
    961961(see the description of @code{shopt} in @ref{Bash Builtins})
    962962is enabled, the match is performed without regard to the case
    963963of alphabetic characters.
    964 The return value is 0 if the string matches or does not match
    965 the pattern, respectively, and 1 otherwise.
     964The return value is 0 if the string matches (@samp{==}) or does not
     965match (@samp{!=})the pattern, and 1 otherwise.
    966966Any part of the pattern may be quoted to force it to be matched as a
    967967string.
    968968
     
    25982598Builtin commands are necessary to implement functionality impossible
    25992599or inconvenient to obtain with separate utilities.
    26002600
    2601 This section briefly the builtins which Bash inherits from
     2601This section briefly describes the builtins which Bash inherits from
    26022602the Bourne Shell, as well as the builtin commands which are unique
    26032603to or have been extended in Bash.
    26042604
     
    38333833@item ulimit
    38343834@btindex ulimit
    38353835@example
    3836 ulimit [-acdflmnpstuvSH] [@var{limit}]
     3836ulimit [-acdfilmnpqstuvxSH] [@var{limit}]
    38373837@end example
    38383838@code{ulimit} provides control over the resources available to processes
    38393839started by the shell, on systems that allow such control.  If an
     
    38573857@item -f
    38583858The maximum size of files created by the shell.
    38593859
     3860@item -i
     3861The maximum number of pending signals.
     3862
    38603863@item -l
    38613864The maximum size that may be locked into memory.
    38623865
     
    38693872@item -p
    38703873The pipe buffer size.
    38713874
     3875@item -q
     3876The maximum number of bytes in POSIX message queues.
     3877
    38723878@item -s
    38733879The maximum stack size.
    38743880
     
    38813887@item -v
    38823888The maximum amount of virtual memory available to the process.
    38833889
     3890@item -x
     3891The maximum number of file locks.
     3892
    38843893@end table
    38853894
    38863895If @var{limit} is given, it is the new value of the specified resource;
     
    40894098Print shell input lines as they are read.
    40904099
    40914100@item -x
    4092 Print a trace of simple commands, \fBfor\fP commands, \fBcase\fP
    4093 commands, \fBselect\fP commands, and arithmetic \fBfor\fP commands
     4101Print a trace of simple commands, @code{for} commands, @code{case}
     4102commands, @code{select} commands, and arithmetic @code{for} commands
    40944103and their arguments or associated word lists after they are
    40954104expanded and before they are executed.  The value of the @env{PS4}
    40964105variable is expanded and the resultant value is printed before
  • doc/version.texi

    diff -Naur bash-3.1.orig/doc/version.texi bash-3.1/doc/version.texi
    old new  
    22Copyright (C) 1988-2005 Free Software Foundation, Inc.
    33@end ignore
    44
    5 @set LASTCHANGE Mon Sep  5 11:47:04 EDT 2005
     5@set LASTCHANGE Fri Dec 30 10:50:51 EST 2005
    66
    7 @set EDITION 3.1-beta1
    8 @set VERSION 3.1-beta1
    9 @set UPDATED 5 September 2005
    10 @set UPDATED-MONTH September 2005
     7@set EDITION 3.1
     8@set VERSION 3.1
     9@set UPDATED 30 December 2005
     10@set UPDATED-MONTH December 2005
  • bash-3.1

    diff -Naur bash-3.1.orig/jobs.c bash-3.1/jobs.c
    old new  
    619619           * once in the parent and once in each child.  This is where
    620620           * the parent gives it away.
    621621           *
     622           * Don't give the terminal away if this shell is an asynchronous
     623           * subshell.
     624           *
    622625           */
    623           if (job_control && newjob->pgrp)
     626          if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0)
    624627            give_terminal_to (newjob->pgrp, 0);
    625628        }
    626629    }
     
    844847realloc_jobs_list ()
    845848{
    846849  sigset_t set, oset;
    847   int nsize, i, j;
     850  int nsize, i, j, ncur, nprev;
    848851  JOB **nlist;
    849852
     853  ncur = nprev = NO_JOB;
    850854  nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS);
    851855  nsize *= JOB_SLOTS;
    852856  i = js.j_njobs % JOB_SLOTS;
     
    854858    nsize += JOB_SLOTS;
    855859
    856860  BLOCK_CHILD (set, oset);
    857   nlist = (JOB **) xmalloc (nsize * sizeof (JOB *));
     861  nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *));
     862
    858863  for (i = j = 0; i < js.j_jobslots; i++)
    859864    if (jobs[i])
    860       nlist[j++] = jobs[i];
     865      {
     866        if (i == js.j_current)
     867          ncur = j;
     868        if (i == js.j_previous)
     869          nprev = j;
     870        nlist[j++] = jobs[i];
     871      }
     872
     873#if defined (DEBUG)
     874  itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize);
     875  itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0);
     876  itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, (j > 0) ? j - 1 : 0);
     877#endif
    861878
    862879  js.j_firstj = 0;
    863   js.j_lastj = (j > 0) ? j - 1: 0;
     880  js.j_lastj = (j > 0) ? j - 1 : 0;
     881  js.j_njobs = j;
    864882  js.j_jobslots = nsize;
    865883
    866   free (jobs);
    867   jobs = nlist;
     884  /* Zero out remaining slots in new jobs list */
     885  for ( ; j < nsize; j++)
     886    nlist[j] = (JOB *)NULL;
     887
     888  if (jobs != nlist)
     889    {
     890      free (jobs);
     891      jobs = nlist;
     892    }
     893
     894  if (ncur != NO_JOB)
     895    js.j_current = ncur;
     896  if (nprev != NO_JOB)
     897    js.j_previous = nprev;
     898
     899  /* Need to reset these */
     900  if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj)
     901    reset_current ();
     902
     903#ifdef DEBUG
     904  itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous);
     905#endif
    868906
    869907  UNBLOCK_CHILD (oset);
    870908}
     
    16551693             In this case, we don't want to give the terminal to the
    16561694             shell's process group (we could be in the middle of a
    16571695             pipeline, for example). */
    1658           if (async_p == 0 && pipeline_pgrp != shell_pgrp)
     1696          if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0))
    16591697            give_terminal_to (pipeline_pgrp, 0);
    16601698
    16611699#if defined (PGRP_PIPE)
     
    21982236  /* This is possibly a race condition -- should it go in stop_pipeline? */
    21992237  wait_sigint_received = 0;
    22002238  if (job_control == 0)
    2201     old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
     2239    {
     2240      old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
     2241      if (old_sigint_handler == SIG_IGN)
     2242        set_signal_handler (SIGINT, old_sigint_handler);
     2243    }
    22022244
    22032245  termination_state = last_command_exit_value;
    22042246
  • lib/glob/glob.c

    diff -Naur bash-3.1.orig/lib/glob/glob.c bash-3.1/lib/glob/glob.c
    old new  
    360360  count = lose = skip = 0;
    361361
    362362  firstmalloc = 0;
     363  nalloca = 0;
    363364
    364365  /* If PAT is empty, skip the loop, but return one (empty) filename. */
    365366  if (pat == 0 || *pat == '\0')
     
    546547                firstmalloc = 0;
    547548              tmplink = lastlink;
    548549            }
     550          else
     551            tmplink = 0;
    549552          free (lastlink->name);
    550553          lastlink = lastlink->next;
    551554          FREE (tmplink);
  • lib/glob/sm_loop.c

    diff -Naur bash-3.1.orig/lib/glob/sm_loop.c bash-3.1/lib/glob/sm_loop.c
    old new  
    638638  CHAR *psub;                   /* pointer to sub-pattern */
    639639  CHAR *pnext;                  /* pointer to next sub-pattern */
    640640  CHAR *srest;                  /* pointer to rest of string */
    641   int m1, m2;
     641  int m1, m2, xflags;           /* xflags = flags passed to recursive matches */
    642642
    643643#if DEBUG_MATCHING
    644644fprintf(stderr, "extmatch: xc = %c\n", xc);
    645645fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se);
    646646fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe);
     647fprintf(stderr, "extmatch: flags = %d\n", flags);
    647648#endif
    648649
    649650  prest = PATSCAN (p + (*p == L('(')), pe, 0); /* ) */
     
    677678                 string matches the rest of the pattern.  Also handle
    678679                 multiple matches of the pattern. */
    679680              if (m1)
    680                 m2 = (GMATCH (srest, se, prest, pe, flags) == 0) ||
    681                       (s != srest && GMATCH (srest, se, p - 1, pe, flags) == 0);
     681                {
     682                  /* if srest > s, we are not at start of string */
     683                  xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
     684                  m2 = (GMATCH (srest, se, prest, pe, xflags) == 0) ||
     685                        (s != srest && GMATCH (srest, se, p - 1, pe, xflags) == 0);
     686                }
    682687              if (m1 && m2)
    683688                return (0);
    684689            }
     
    704709          srest = (prest == pe) ? se : s;
    705710          for ( ; srest <= se; srest++)
    706711            {
     712              /* if srest > s, we are not at start of string */
     713              xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
    707714              if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 &&
    708                   GMATCH (srest, se, prest, pe, flags) == 0)
     715                  GMATCH (srest, se, prest, pe, xflags) == 0)
    709716                return (0);
    710717            }
    711718          if (pnext == prest)
     
    726733              if (pnext == prest)
    727734                break;
    728735            }
    729           if (m1 == 0 && GMATCH (srest, se, prest, pe, flags) == 0)
     736          /* if srest > s, we are not at start of string */
     737          xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
     738          if (m1 == 0 && GMATCH (srest, se, prest, pe, xflags) == 0)
    730739            return (0);
    731740        }
    732741      return (FNM_NOMATCH);
  • lib/readline/display.c

    diff -Naur bash-3.1.orig/lib/readline/display.c bash-3.1/lib/readline/display.c
    old new  
    19831983     int pchar;
    19841984{
    19851985  int len;
    1986   char *pmt;
     1986  char *pmt, *p;
    19871987
    19881988  rl_save_prompt ();
    19891989
    1990   if (saved_local_prompt == 0)
     1990  /* We've saved the prompt, and can do anything with the various prompt
     1991     strings we need before they're restored.  We want the unexpanded
     1992     portion of the prompt string after any final newline. */
     1993  p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
     1994  if (p == 0)
    19911995    {
    19921996      len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
    19931997      pmt = (char *)xmalloc (len + 2);
     
    19982002    }
    19992003  else
    20002004    {
    2001       len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
     2005      p++;
     2006      len = strlen (p);
    20022007      pmt = (char *)xmalloc (len + 2);
    20032008      if (len)
    2004         strcpy (pmt, saved_local_prompt);
     2009        strcpy (pmt, p);
    20052010      pmt[len] = pchar;
    20062011      pmt[len+1] = '\0';
    2007       local_prompt = savestring (pmt);
    2008       prompt_last_invisible = saved_last_invisible;
    2009       prompt_visible_length = saved_visible_length + 1;
    2010     }
     2012    } 
    20112013
     2014  /* will be overwritten by expand_prompt, called from rl_message */
    20122015  prompt_physical_chars = saved_physical_chars + 1;
    2013 
    20142016  return pmt;
    20152017}
    20162018
  • lib/readline/readline.c

    diff -Naur bash-3.1.orig/lib/readline/readline.c bash-3.1/lib/readline/readline.c
    old new  
    282282{
    283283  FREE (rl_prompt);
    284284  rl_prompt = prompt ? savestring (prompt) : (char *)NULL;
     285  rl_display_prompt = rl_prompt ? rl_prompt : "";
    285286
    286287  rl_visible_prompt_length = rl_expand_prompt (rl_prompt);
    287288  return 0;
  • lib/readline/terminal.c

    diff -Naur bash-3.1.orig/lib/readline/terminal.c bash-3.1/lib/readline/terminal.c
    old new  
    122122static char *_rl_visible_bell;
    123123
    124124/* Non-zero means the terminal can auto-wrap lines. */
    125 int _rl_term_autowrap;
     125int _rl_term_autowrap = -1;
    126126
    127127/* Non-zero means that this terminal has a meta key. */
    128128static int term_has_meta;
     
    274274_rl_set_screen_size (rows, cols)
    275275     int rows, cols;
    276276{
     277  if (_rl_term_autowrap == -1)
     278    _rl_init_terminal_io (rl_terminal_name);
     279
    277280  if (rows > 0)
    278281    _rl_screenheight = rows;
    279282  if (cols > 0)
  • parse.y

    diff -Naur bash-3.1.orig/parse.y bash-3.1/parse.y
    old new  
    27162716#define P_ALLOWESC      0x02
    27172717#define P_DQUOTE        0x04
    27182718#define P_COMMAND       0x08    /* parsing a command, so look for comments */
     2719#define P_BACKQUOTE     0x10    /* parsing a backquoted command substitution */
    27192720
    27202721static char matched_pair_error;
    27212722static char *
     
    27252726     int *lenp, flags;
    27262727{
    27272728  int count, ch, was_dollar, in_comment, check_comment;
    2728   int pass_next_character, nestlen, ttranslen, start_lineno;
     2729  int pass_next_character, backq_backslash, nestlen, ttranslen, start_lineno;
    27292730  char *ret, *nestret, *ttrans;
    27302731  int retind, retsize, rflags;
    27312732
    27322733  count = 1;
    2733   pass_next_character = was_dollar = in_comment = 0;
     2734  pass_next_character = backq_backslash = was_dollar = in_comment = 0;
    27342735  check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0;
    27352736
    27362737  /* RFLAGS is the set of flags we want to pass to recursive calls. */
     
    27422743  start_lineno = line_number;
    27432744  while (count)
    27442745    {
    2745 #if 0
    2746       ch = shell_getc ((qc != '\'' || (flags & P_ALLOWESC)) && pass_next_character == 0);
    2747 #else
    2748       ch = shell_getc (qc != '\'' && pass_next_character == 0);
    2749 #endif
     2746      ch = shell_getc (qc != '\'' && pass_next_character == 0 && backq_backslash == 0);
     2747
    27502748      if (ch == EOF)
    27512749        {
    27522750          free (ret);
     
    27712769          continue;
    27722770        }
    27732771      /* Not exactly right yet */
    2774       else if (check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind -1])))
     2772      else if MBTEST(check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind - 1])))
    27752773        in_comment = 1;
    27762774
     2775      /* last char was backslash inside backquoted command substitution */
     2776      if (backq_backslash)
     2777        {
     2778          backq_backslash = 0;
     2779          /* Placeholder for adding special characters */
     2780        }
     2781
    27772782      if (pass_next_character)          /* last char was backslash */
    27782783        {
    27792784          pass_next_character = 0;
     
    28142819        {
    28152820          if MBTEST((flags & P_ALLOWESC) && ch == '\\')
    28162821            pass_next_character++;
     2822          else if MBTEST((flags & P_BACKQUOTE) && ch == '\\')
     2823            backq_backslash++;
    28172824          continue;
    28182825        }
    28192826
     
    28982905        }
    28992906      else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 0)
    29002907        {
    2901           nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags);
     2908          /* Add P_BACKQUOTE so backslash quotes the next character and
     2909             shell_getc does the right thing with \<newline>.  We do this for
     2910             a measure  of backwards compatibility -- it's not strictly the
     2911             right POSIX thing. */
     2912          nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags|P_BACKQUOTE);
    29022913          goto add_nestret;
    29032914        }
    29042915      else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '['))       /* ) } ] */
     
    29072918          if (open == ch)       /* undo previous increment */
    29082919            count--;
    29092920          if (ch == '(')                /* ) */
    2910             nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags);
     2921            nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags & ~P_DQUOTE);
    29112922          else if (ch == '{')           /* } */
    29122923            nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|rflags);
    29132924          else if (ch == '[')           /* ] */
     
    35783589              FREE (ttok);
    35793590              all_digit_token = 0;
    35803591              compound_assignment = 1;
    3581 #if 0
     3592#if 1
    35823593              goto next_character;
    35833594#else
    35843595              goto got_token;           /* ksh93 seems to do this */
     
    36953706      struct builtin *b;
    36963707      b = builtin_address_internal (token, 0);
    36973708      if (b && (b->flags & ASSIGNMENT_BUILTIN))
    3698         parser_state |= PST_ASSIGNOK;
     3709        parser_state |= PST_ASSIGNOK;
     3710      else if (STREQ (token, "eval") || STREQ (token, "let"))
     3711        parser_state |= PST_ASSIGNOK;
    36993712    }
    37003713
    37013714  yylval.word = the_word;
     
    46864699     int *retlenp;
    46874700{
    46884701  WORD_LIST *wl, *rl;
    4689   int tok, orig_line_number, orig_token_size;
     4702  int tok, orig_line_number, orig_token_size, orig_last_token, assignok;
    46904703  char *saved_token, *ret;
    46914704
    46924705  saved_token = token;
    46934706  orig_token_size = token_buffer_size;
    46944707  orig_line_number = line_number;
     4708  orig_last_token = last_read_token;
    46954709
    46964710  last_read_token = WORD;       /* WORD to allow reserved words here */
    46974711
    46984712  token = (char *)NULL;
    46994713  token_buffer_size = 0;
    47004714
     4715  assignok = parser_state&PST_ASSIGNOK;         /* XXX */
     4716
    47014717  wl = (WORD_LIST *)NULL;       /* ( */
    47024718  parser_state |= PST_COMPASSIGN;
    47034719
     
    47404756        jump_to_top_level (DISCARD);
    47414757    }
    47424758
    4743   last_read_token = WORD;
     4759  last_read_token = orig_last_token;            /* XXX - was WORD? */
    47444760  if (wl)
    47454761    {
    47464762      rl = REVERSE_LIST (wl, WORD_LIST *);
     
    47524768
    47534769  if (retlenp)
    47544770    *retlenp = (ret && *ret) ? strlen (ret) : 0;
     4771
     4772  if (assignok)
     4773    parser_state |= PST_ASSIGNOK;
     4774
    47554775  return ret;
    47564776}
    47574777
  • patchlevel.h

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

    diff -Naur bash-3.1.orig/subst.c bash-3.1/subst.c
    old new  
    21872187  if (mklocal && variable_context)
    21882188    {
    21892189      v = find_variable (name);
    2190       if (v == 0 || array_p (v) == 0)
     2190      if (v == 0 || array_p (v) == 0 || v->context != variable_context)
    21912191        v = make_local_array_variable (name);
    21922192      v = assign_array_var_from_string (v, value, flags);
    21932193    }
     
    67956795          if (temp && *temp && t_index > 0)
    67966796            {
    67976797              temp1 = bash_tilde_expand (temp, tflag);
     6798              if  (temp1 && *temp1 == '~' && STREQ (temp, temp1))
     6799                {
     6800                  FREE (temp);
     6801                  FREE (temp1);
     6802                  goto add_character;           /* tilde expansion failed */
     6803                }
    67986804              free (temp);
    67996805              temp = temp1;
    68006806              sindex += t_index;
  • variables.c

    diff -Naur bash-3.1.orig/variables.c bash-3.1/variables.c
    old new  
    860860{
    861861  char val[INT_STRLEN_BOUND(int) + 1], *v;
    862862
     863#if defined (READLINE)
    863864  /* If we are currently assigning to LINES or COLUMNS, don't do anything. */
    864865  if (winsize_assignment)
    865866    return;
     867#endif
    866868
    867869  v = inttostr (lines, val, sizeof (val));
    868870  bind_variable ("LINES", v, 0);
Note: See TracBrowser for help on using the repository browser.