Changeset 973b90d5 for patches


Ignore:
Timestamp:
Mar 9, 2009, 3:10:27 PM (16 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
087231b
Parents:
5d7c3f5
Message:

Updated Bash Branch Update Patch to -3

File:
1 moved

Legend:

Unmodified
Added
Removed
  • patches/bash-4.0-branch_update-3.patch

    r5d7c3f5 r973b90d5  
    11Submitted By: Jim Gifford (jim at cross-lfs dot org)
    2 Date: 03-02-2009
     2Date: 03-09-2009
    33Initial Package Version: 4.0
    44Origin: Upstream
    55Upstream Status: Applied
    6 Description: Fixes from the Mailing List - Bash Bug
    7              http://lists.gnu.org/archive/html/bug-bash/2009-02/index.html
     6Description: Contains all upstream patches up to 4.0-010
    87
    98diff -Naur bash-4.0.orig/arrayfunc.c bash-4.0/arrayfunc.c
    109--- bash-4.0.orig/arrayfunc.c   2009-01-04 11:32:21.000000000 -0800
    11 +++ bash-4.0/arrayfunc.c        2009-03-02 12:37:07.363274758 -0800
     10+++ bash-4.0/arrayfunc.c        2009-03-09 15:07:05.270012850 -0700
    1211@@ -604,64 +604,7 @@
    1312     }
     
    7877diff -Naur bash-4.0.orig/builtins/declare.def bash-4.0/builtins/declare.def
    7978--- bash-4.0.orig/builtins/declare.def  2009-01-04 11:32:22.000000000 -0800
    80 +++ bash-4.0/builtins/declare.def       2009-03-02 12:37:07.363274758 -0800
    81 @@ -287,6 +287,12 @@
    82               name[offset - 1] = '\0';
    83             }
    84         }
    85 +      else if (legal_identifier (name) == 0)
    86 +       {
    87 +         sh_invalidid (name);
    88 +         assign_error++;
    89 +         NEXT_VARIABLE ();
    90 +       }
    91        else
    92         value = "";
    93  
    94 @@ -295,6 +301,13 @@
     79+++ bash-4.0/builtins/declare.def       2009-03-09 15:07:02.561839362 -0700
     80@@ -295,6 +295,13 @@
    9581       subscript_start = (char *)NULL;
    9682       if (t = strchr (name, '['))      /* ] */
     
    10692          *t = '\0';
    10793          making_array_special = 1;
    108 @@ -484,7 +497,7 @@
     94@@ -484,7 +491,7 @@
    10995            }
    11096          /* declare -a name[[n]] or declare name[n] makes name an indexed
     
    117103diff -Naur bash-4.0.orig/builtins/exit.def bash-4.0/builtins/exit.def
    118104--- bash-4.0.orig/builtins/exit.def     2009-01-04 11:32:22.000000000 -0800
    119 +++ bash-4.0/builtins/exit.def  2009-03-02 12:37:07.367275038 -0800
     105+++ bash-4.0/builtins/exit.def  2009-03-09 15:07:01.245754993 -0700
    120106@@ -113,7 +113,7 @@
    121107       for (i = stopmsg = 0; i < js.j_jobslots; i++)
     
    129115diff -Naur bash-4.0.orig/builtins/read.def bash-4.0/builtins/read.def
    130116--- bash-4.0.orig/builtins/read.def     2009-01-15 20:11:21.000000000 -0800
    131 +++ bash-4.0/builtins/read.def  2009-03-02 13:01:12.743891046 -0800
     117+++ bash-4.0/builtins/read.def  2009-03-09 15:07:07.890180751 -0700
    132118@@ -369,14 +369,14 @@
    133119       code = setjmp (alrmbuf);
     
    152138diff -Naur bash-4.0.orig/parse.y bash-4.0/parse.y
    153139--- bash-4.0.orig/parse.y       2009-01-08 05:29:12.000000000 -0800
    154 +++ bash-4.0/parse.y    2009-03-02 12:37:07.367275038 -0800
     140+++ bash-4.0/parse.y    2009-03-09 15:07:09.194264282 -0700
    155141@@ -1615,10 +1615,11 @@
    156142 {
     
    190176 /* Lexical state while parsing a grouping construct or $(...). */
    191177 #define LEX_WASDOL     0x001
    192 @@ -3129,6 +3133,8 @@
     178@@ -2927,6 +2931,7 @@
     179 #define LEX_INHEREDOC  0x080
     180 #define LEX_HEREDELIM  0x100           /* reading here-doc delimiter */
     181 #define LEX_STRIPDOC   0x200           /* <<- strip tabs from here doc delim */
     182+#define LEX_INWORD     0x400
     183 
     184 #define COMSUB_META(ch)                ((ch) == ';' || (ch) == '&' || (ch) == '|')
     185 
     186@@ -3129,6 +3134,8 @@
    193187              APPEND_NESTRET ();
    194188              FREE (nestret);
     
    199193       /* Parse an old-style command substitution within double quotes as a
    200194         single word. */
    201 @@ -3145,6 +3151,7 @@
     195@@ -3145,6 +3152,7 @@
    202196       else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '['))    /* ) } ] */
    203197        /* check for $(), $[], or ${} inside quoted string. */
     
    207201            count--;
    208202          if (ch == '(')                /* ) */
    209 @@ -3306,7 +3313,7 @@
     203@@ -3179,7 +3187,7 @@
     204      int open, close;
     205      int *lenp, flags;
     206 {
     207-  int count, ch, peekc, tflags, lex_rwlen, lex_firstind;
     208+  int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind;
     209   int nestlen, ttranslen, start_lineno;
     210   char *ret, *nestret, *ttrans, *heredelim;
     211   int retind, retsize, rflags, hdlen;
     212@@ -3200,7 +3208,7 @@
     213   retind = 0;
     214 
     215   start_lineno = line_number;
     216-  lex_rwlen = 0;
     217+  lex_rwlen = lex_wlen = 0;
     218 
     219   heredelim = 0;
     220   lex_firstind = -1;
     221@@ -3267,6 +3275,46 @@
     222          continue;
    210223        }
    211224 
    212        /* Meta-characters that can introduce a reserved word.  Not perfect yet. */
    213 -      if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && shellmeta(ch))
    214 +      if MBTEST((tflags & LEX_PASSNEXT) == 0 && (tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && shellmeta(ch))
    215         {
    216           /* Add this character. */
    217           RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);
    218 @@ -3394,8 +3401,11 @@
     225+      if (tflags & LEX_PASSNEXT)               /* last char was backslash */
     226+       {
     227+/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/
     228+         tflags &= ~LEX_PASSNEXT;
     229+         if (qc != '\'' && ch == '\n') /* double-quoted \<newline> disappears. */
     230+           {
     231+             if (retind > 0)
     232+               retind--;       /* swallow previously-added backslash */
     233+             continue;
     234+           }
     235+
     236+         RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);
     237+         if MBTEST(ch == CTLESC || ch == CTLNUL)
     238+           ret[retind++] = CTLESC;
     239+         ret[retind++] = ch;
     240+         continue;
     241+       }
     242+
     243+      /* If this is a shell break character, we are not in a word.  If not,
     244+        we either start or continue a word. */
     245+      if MBTEST(shellbreak (ch))
     246+       {
     247+         tflags &= ~LEX_INWORD;
     248+/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/
     249+       }
     250+      else
     251+       {
     252+         if (tflags & LEX_INWORD)
     253+           {
     254+             lex_wlen++;
     255+/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/
     256+           }         
     257+         else
     258+           {
     259+/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/
     260+             tflags |= LEX_INWORD;
     261+             lex_wlen = 0;
     262+           }
     263+       }
     264+
     265       /* Skip whitespace */
     266       if MBTEST(shellblank (ch) && lex_rwlen == 0)
     267         {
     268@@ -3364,9 +3412,21 @@
     269 }             
     270              tflags &= ~LEX_RESWDOK;
     271            }
     272-         else if (shellbreak (ch) == 0)
     273+         else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))
     274+           ;   /* don't modify LEX_RESWDOK if we're starting a comment */
     275+         else if MBTEST((tflags & LEX_INCASE) && ch != '\n')
     276+           /* If we can read a reserved word and we're in case, we're at the
     277+              point where we can read a new pattern list or an esac.  We
     278+              handle the esac case above.  If we read a newline, we want to
     279+              leave LEX_RESWDOK alone.  If we read anything else, we want to
     280+              turn off LEX_RESWDOK, since we're going to read a pattern list. */
     281 {
     282-             tflags &= ~LEX_RESWDOK;
     283+           tflags &= ~LEX_RESWDOK;
     284+/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/
     285+}
     286+         else if MBTEST(shellbreak (ch) == 0)
     287+{
     288+           tflags &= ~LEX_RESWDOK;
     289 /*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/
     290 }
     291        }
     292@@ -3394,36 +3454,23 @@
    219293                }
    220294              else
     
    230304            }
    231305          else
    232 @@ -4248,7 +4258,7 @@
     306-           ch = peekc;         /* fall through and continue XXX - this skips comments if peekc == '#' */
     307+           ch = peekc;         /* fall through and continue XXX */
     308        }
     309-      /* Not exactly right yet, should handle shell metacharacters, too.  If
     310-        any changes are made to this test, make analogous changes to subst.c:
     311-        extract_delimited_string(). */
     312-      else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1])))
     313+      else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0)))
     314+{
     315+/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/
     316        tflags |= LEX_INCOMMENT;
     317+}
     318 
     319-      if (tflags & LEX_PASSNEXT)               /* last char was backslash */
     320-       {
     321-         tflags &= ~LEX_PASSNEXT;
     322-         if (qc != '\'' && ch == '\n') /* double-quoted \<newline> disappears. */
     323-           {
     324-             if (retind > 0)
     325-               retind--;       /* swallow previously-added backslash */
     326-             continue;
     327-           }
     328-
     329-         RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);
     330-         if MBTEST(ch == CTLESC || ch == CTLNUL)
     331-           ret[retind++] = CTLESC;
     332-         ret[retind++] = ch;
     333-         continue;
     334-       }
     335-      else if MBTEST(ch == CTLESC || ch == CTLNUL)     /* special shell escapes */
     336+      if MBTEST(ch == CTLESC || ch == CTLNUL)  /* special shell escapes */
     337        {
     338          RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);
     339          ret[retind++] = CTLESC;
     340@@ -4248,7 +4295,7 @@
    233341                     ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) ||
    234342                      (token_index == 0 && (parser_state&PST_COMPASSIGN))))
     
    239347            return -1;          /* Bail immediately. */
    240348          RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2,
    241 @@ -4449,6 +4459,7 @@
     349@@ -4449,6 +4496,7 @@
    242350     case '}':          /* XXX */
    243351     case AND_AND:
     
    247355     case DONE:
    248356     case ELIF:
     357diff -Naur bash-4.0.orig/patchlevel.h bash-4.0/patchlevel.h
     358--- bash-4.0.orig/patchlevel.h  2009-01-04 11:32:40.000000000 -0800
     359+++ bash-4.0/patchlevel.h       2009-03-09 15:07:09.194264282 -0700
     360@@ -25,6 +25,6 @@
     361    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
     362    looks for to find the patch level (for the sccs version string). */
     363 
     364-#define PATCHLEVEL 0
     365+#define PATCHLEVEL 10
     366 
     367 #endif /* _PATCHLEVEL_H_ */
    249368diff -Naur bash-4.0.orig/pcomplete.c bash-4.0/pcomplete.c
    250369--- bash-4.0.orig/pcomplete.c   2009-02-01 14:12:31.000000000 -0800
    251 +++ bash-4.0/pcomplete.c        2009-03-02 12:37:07.367275038 -0800
     370+++ bash-4.0/pcomplete.c        2009-03-09 15:06:58.589584858 -0700
    252371@@ -1032,6 +1032,7 @@
    253372   cmdlist = build_arg_list (funcname, text, lwords, cw);
     
    260379diff -Naur bash-4.0.orig/subst.c bash-4.0/subst.c
    261380--- bash-4.0.orig/subst.c       2009-01-28 11:34:12.000000000 -0800
    262 +++ bash-4.0/subst.c    2009-03-02 12:37:07.371275038 -0800
     381+++ bash-4.0/subst.c    2009-03-09 15:07:05.274015365 -0700
    263382@@ -222,6 +222,7 @@
    264383 static int skip_double_quoted __P((char *, size_t, int));
     
    377496    the index of that character.  START is the index into string at which we
    378497    begin.  This is similar in spirit to strpbrk, but it returns an index into
    379 
Note: See TracChangeset for help on using the changeset viewer.