source: patches/bash-3.2-fixes-2.patch@ 645e8db

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 645e8db was 6704f71, checked in by Jim Gifford <clfs@…>, 18 years ago

Updated Bash 3.2 Patch

  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[6704f71]1Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
2Date: 2006-10-31
3Initial Package Version: 3.2
4Origin: ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
5Upstream Status: From Upstream
6Description: Contains patches 001-003 from upstream
7
8diff -Naur bash-3.2.orig/parse.y bash-3.2/parse.y
9--- bash-3.2.orig/parse.y 2006-09-19 13:37:21.000000000 -0700
10+++ bash-3.2/parse.y 2006-10-31 21:30:32.383533860 -0800
11@@ -1029,6 +1029,7 @@
12 #define PST_CMDTOKEN 0x1000 /* command token OK - unused */
13 #define PST_COMPASSIGN 0x2000 /* parsing x=(...) compound assignment */
14 #define PST_ASSIGNOK 0x4000 /* assignment statement ok in this context */
15+#define PST_REGEXP 0x8000 /* parsing an ERE/BRE as a single word */
16
17 /* Initial size to allocate for tokens, and the
18 amount to grow them by. */
19@@ -2591,6 +2592,9 @@
20 return (character);
21 }
22
23+ if (parser_state & PST_REGEXP)
24+ goto tokword;
25+
26 /* Shell meta-characters. */
27 if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0))
28 {
29@@ -2698,6 +2702,7 @@
30 if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND))
31 return (character);
32
33+tokword:
34 /* Okay, if we got this far, we have to read a word. Read one,
35 and then check it against the known ones. */
36 result = read_token_word (character);
37@@ -2735,7 +2740,7 @@
38 /* itrace("parse_matched_pair: open = %c close = %c", open, close); */
39 count = 1;
40 pass_next_character = backq_backslash = was_dollar = in_comment = 0;
41- check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0;
42+ check_comment = (flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0;
43
44 /* RFLAGS is the set of flags we want to pass to recursive calls. */
45 rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE);
46@@ -3202,8 +3207,11 @@
47 if (tok == WORD && test_binop (yylval.word->word))
48 op = yylval.word;
49 #if defined (COND_REGEXP)
50- else if (tok == WORD && STREQ (yylval.word->word,"=~"))
51- op = yylval.word;
52+ else if (tok == WORD && STREQ (yylval.word->word, "=~"))
53+ {
54+ op = yylval.word;
55+ parser_state |= PST_REGEXP;
56+ }
57 #endif
58 else if (tok == '<' || tok == '>')
59 op = make_word_from_token (tok); /* ( */
60@@ -3234,6 +3242,7 @@
61
62 /* rhs */
63 tok = read_token (READ);
64+ parser_state &= ~PST_REGEXP;
65 if (tok == WORD)
66 {
67 tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL);
68@@ -3419,9 +3428,34 @@
69 goto next_character;
70 }
71
72+#ifdef COND_REGEXP
73+ /* When parsing a regexp as a single word inside a conditional command,
74+ we need to special-case characters special to both the shell and
75+ regular expressions. Right now, that is only '(' and '|'. */ /*)*/
76+ if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/
77+ {
78+ if (character == '|')
79+ goto got_character;
80+
81+ push_delimiter (dstack, character);
82+ ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0);
83+ pop_delimiter (dstack);
84+ if (ttok == &matched_pair_error)
85+ return -1; /* Bail immediately. */
86+ RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2,
87+ token_buffer_size, TOKEN_DEFAULT_GROW_SIZE);
88+ token[token_index++] = character;
89+ strcpy (token + token_index, ttok);
90+ token_index += ttoklen;
91+ FREE (ttok);
92+ dollar_present = all_digit_token = 0;
93+ goto next_character;
94+ }
95+#endif /* COND_REGEXP */
96+
97 #ifdef EXTENDED_GLOB
98 /* Parse a ksh-style extended pattern matching specification. */
99- if (extended_glob && PATTERN_CHAR (character))
100+ if MBTEST(extended_glob && PATTERN_CHAR (character))
101 {
102 peek_char = shell_getc (1);
103 if MBTEST(peek_char == '(') /* ) */
104diff -Naur bash-3.2.orig/patchlevel.h bash-3.2/patchlevel.h
105--- bash-3.2.orig/patchlevel.h 2006-04-13 05:31:04.000000000 -0700
106+++ bash-3.2/patchlevel.h 2006-10-31 21:30:32.383533860 -0800
107@@ -25,6 +25,6 @@
108 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
109 looks for to find the patch level (for the sccs version string). */
110
111-#define PATCHLEVEL 0
112+#define PATCHLEVEL 3
113
114 #endif /* _PATCHLEVEL_H_ */
115diff -Naur bash-3.2.orig/po/ru.po bash-3.2/po/ru.po
116--- bash-3.2.orig/po/ru.po 2006-01-10 14:51:03.000000000 -0800
117+++ bash-3.2/po/ru.po 2006-10-31 21:30:12.616221385 -0800
118@@ -12,7 +12,7 @@
119 "Last-Translator: Evgeniy Dushistov <dushistov@mail.ru>\n"
120 "Language-Team: Russian <ru@li.org>\n"
121 "MIME-Version: 1.0\n"
122-"Content-Type: text/plain; charset=UTF-8\n"
123+"Content-Type: text/plain; charset=KOI8-R\n"
124 "Content-Transfer-Encoding: 8bit\n"
125 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
126
Note: See TracBrowser for help on using the repository browser.