- Timestamp:
- Mar 9, 2009, 3:10:27 PM (16 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 087231b
- Parents:
- 5d7c3f5
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
patches/bash-4.0-branch_update-3.patch
r5d7c3f5 r973b90d5 1 1 Submitted By: Jim Gifford (jim at cross-lfs dot org) 2 Date: 03-0 2-20092 Date: 03-09-2009 3 3 Initial Package Version: 4.0 4 4 Origin: Upstream 5 5 Upstream Status: Applied 6 Description: Fixes from the Mailing List - Bash Bug 7 http://lists.gnu.org/archive/html/bug-bash/2009-02/index.html 6 Description: Contains all upstream patches up to 4.0-010 8 7 9 8 diff -Naur bash-4.0.orig/arrayfunc.c bash-4.0/arrayfunc.c 10 9 --- bash-4.0.orig/arrayfunc.c 2009-01-04 11:32:21.000000000 -0800 11 +++ bash-4.0/arrayfunc.c 2009-03-0 2 12:37:07.363274758 -080010 +++ bash-4.0/arrayfunc.c 2009-03-09 15:07:05.270012850 -0700 12 11 @@ -604,64 +604,7 @@ 13 12 } … … 78 77 diff -Naur bash-4.0.orig/builtins/declare.def bash-4.0/builtins/declare.def 79 78 --- 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 @@ 95 81 subscript_start = (char *)NULL; 96 82 if (t = strchr (name, '[')) /* ] */ … … 106 92 *t = '\0'; 107 93 making_array_special = 1; 108 @@ -484,7 +49 7,7 @@94 @@ -484,7 +491,7 @@ 109 95 } 110 96 /* declare -a name[[n]] or declare name[n] makes name an indexed … … 117 103 diff -Naur bash-4.0.orig/builtins/exit.def bash-4.0/builtins/exit.def 118 104 --- bash-4.0.orig/builtins/exit.def 2009-01-04 11:32:22.000000000 -0800 119 +++ bash-4.0/builtins/exit.def 2009-03-0 2 12:37:07.367275038 -0800105 +++ bash-4.0/builtins/exit.def 2009-03-09 15:07:01.245754993 -0700 120 106 @@ -113,7 +113,7 @@ 121 107 for (i = stopmsg = 0; i < js.j_jobslots; i++) … … 129 115 diff -Naur bash-4.0.orig/builtins/read.def bash-4.0/builtins/read.def 130 116 --- bash-4.0.orig/builtins/read.def 2009-01-15 20:11:21.000000000 -0800 131 +++ bash-4.0/builtins/read.def 2009-03-0 2 13:01:12.743891046 -0800117 +++ bash-4.0/builtins/read.def 2009-03-09 15:07:07.890180751 -0700 132 118 @@ -369,14 +369,14 @@ 133 119 code = setjmp (alrmbuf); … … 152 138 diff -Naur bash-4.0.orig/parse.y bash-4.0/parse.y 153 139 --- bash-4.0.orig/parse.y 2009-01-08 05:29:12.000000000 -0800 154 +++ bash-4.0/parse.y 2009-03-0 2 12:37:07.367275038 -0800140 +++ bash-4.0/parse.y 2009-03-09 15:07:09.194264282 -0700 155 141 @@ -1615,10 +1615,11 @@ 156 142 { … … 190 176 /* Lexical state while parsing a grouping construct or $(...). */ 191 177 #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 @@ 193 187 APPEND_NESTRET (); 194 188 FREE (nestret); … … 199 193 /* Parse an old-style command substitution within double quotes as a 200 194 single word. */ 201 @@ -3145,6 +315 1,7 @@195 @@ -3145,6 +3152,7 @@ 202 196 else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ 203 197 /* check for $(), $[], or ${} inside quoted string. */ … … 207 201 count--; 208 202 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; 210 223 } 211 224 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 @@ 219 293 } 220 294 else … … 230 304 } 231 305 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 @@ 233 341 ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || 234 342 (token_index == 0 && (parser_state&PST_COMPASSIGN)))) … … 239 347 return -1; /* Bail immediately. */ 240 348 RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, 241 @@ -4449,6 +44 59,7 @@349 @@ -4449,6 +4496,7 @@ 242 350 case '}': /* XXX */ 243 351 case AND_AND: … … 247 355 case DONE: 248 356 case ELIF: 357 diff -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_ */ 249 368 diff -Naur bash-4.0.orig/pcomplete.c bash-4.0/pcomplete.c 250 369 --- bash-4.0.orig/pcomplete.c 2009-02-01 14:12:31.000000000 -0800 251 +++ bash-4.0/pcomplete.c 2009-03-0 2 12:37:07.367275038 -0800370 +++ bash-4.0/pcomplete.c 2009-03-09 15:06:58.589584858 -0700 252 371 @@ -1032,6 +1032,7 @@ 253 372 cmdlist = build_arg_list (funcname, text, lwords, cw); … … 260 379 diff -Naur bash-4.0.orig/subst.c bash-4.0/subst.c 261 380 --- bash-4.0.orig/subst.c 2009-01-28 11:34:12.000000000 -0800 262 +++ bash-4.0/subst.c 2009-03-0 2 12:37:07.371275038 -0800381 +++ bash-4.0/subst.c 2009-03-09 15:07:05.274015365 -0700 263 382 @@ -222,6 +222,7 @@ 264 383 static int skip_double_quoted __P((char *, size_t, int)); … … 377 496 the index of that character. START is the index into string at which we 378 497 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.