source: patches/bash-4.3-branch_update-1.patch@ e0e2e20

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since e0e2e20 was b12793f, checked in by William Harrington <kb0iic@…>, 11 years ago

Add bash 4.3 branch update patch.

  • Property mode set to 100644
File size: 8.8 KB
RevLine 
[b12793f]1Submitted By: William Harrington (kb0iic at cross-lfs dot org)
2Date: 03-30-2014
3Initial Package Version: 4.3
4Origin: Upstream
5Upstream Status: Applied
6Description: Contains all upstream patches up to 4.3-008
7
8diff -Naur bash-4.3.orig/arrayfunc.c bash-4.3/arrayfunc.c
9--- bash-4.3.orig/arrayfunc.c 2013-08-02 15:19:59.000000000 -0500
10+++ bash-4.3/arrayfunc.c 2014-03-30 08:38:16.233599982 -0500
11@@ -597,6 +597,11 @@
12 if (assoc_p (var))
13 {
14 val = expand_assignment_string_to_string (val, 0);
15+ if (val == 0)
16+ {
17+ val = (char *)xmalloc (1);
18+ val[0] = '\0'; /* like do_assignment_internal */
19+ }
20 free_val = 1;
21 }
22
23diff -Naur bash-4.3.orig/jobs.c bash-4.3/jobs.c
24--- bash-4.3.orig/jobs.c 2014-01-10 08:05:34.000000000 -0600
25+++ bash-4.3/jobs.c 2014-03-30 08:38:14.340206206 -0500
26@@ -4374,7 +4374,7 @@
27 void
28 end_job_control ()
29 {
30- if (interactive_shell) /* XXX - should it be interactive? */
31+ if (interactive_shell || job_control) /* XXX - should it be just job_control? */
32 {
33 terminate_stopped_jobs ();
34
35diff -Naur bash-4.3.orig/lib/glob/glob.c bash-4.3/lib/glob/glob.c
36--- bash-4.3.orig/lib/glob/glob.c 2014-01-31 20:43:51.000000000 -0600
37+++ bash-4.3/lib/glob/glob.c 2014-03-30 08:38:18.153657420 -0500
38@@ -179,42 +179,50 @@
39 char *pat, *dname;
40 int flags;
41 {
42- char *pp, *pe, *t;
43- int n, r;
44+ char *pp, *pe, *t, *se;
45+ int n, r, negate;
46
47+ negate = *pat == '!';
48 pp = pat + 2;
49- pe = pp + strlen (pp) - 1; /*(*/
50- if (*pe != ')')
51- return 0;
52- if ((t = strchr (pp, '|')) == 0) /* easy case first */
53+ se = pp + strlen (pp) - 1; /* end of string */
54+ pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */
55+ /* we should check for invalid extglob pattern here */
56+ /* if pe != se we have more of the pattern at the end of the extglob
57+ pattern. Check the easy case first ( */
58+ if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
59 {
60 *pe = '\0';
61+#if defined (HANDLE_MULTIBYTE)
62+ r = mbskipname (pp, dname, flags);
63+#else
64 r = skipname (pp, dname, flags); /*(*/
65+#endif
66 *pe = ')';
67 return r;
68 }
69+
70+ /* check every subpattern */
71 while (t = glob_patscan (pp, pe, '|'))
72 {
73 n = t[-1];
74 t[-1] = '\0';
75+#if defined (HANDLE_MULTIBYTE)
76+ r = mbskipname (pp, dname, flags);
77+#else
78 r = skipname (pp, dname, flags);
79+#endif
80 t[-1] = n;
81 if (r == 0) /* if any pattern says not skip, we don't skip */
82 return r;
83 pp = t;
84 } /*(*/
85
86- if (pp == pe) /* glob_patscan might find end of pattern */
87+ /* glob_patscan might find end of pattern */
88+ if (pp == se)
89 return r;
90
91- *pe = '\0';
92-# if defined (HANDLE_MULTIBYTE)
93- r = mbskipname (pp, dname, flags); /*(*/
94-# else
95- r = skipname (pp, dname, flags); /*(*/
96-# endif
97- *pe = ')';
98- return r;
99+ /* but if it doesn't then we didn't match a leading dot */
100+ return 0;
101 }
102 #endif
103
104@@ -277,20 +285,23 @@
105 int flags;
106 {
107 #if EXTENDED_GLOB
108- wchar_t *pp, *pe, *t, n;
109- int r;
110+ wchar_t *pp, *pe, *t, n, *se;
111+ int r, negate;
112
113+ negate = *pat == L'!';
114 pp = pat + 2;
115- pe = pp + wcslen (pp) - 1; /*(*/
116- if (*pe != L')')
117- return 0;
118- if ((t = wcschr (pp, L'|')) == 0)
119+ se = pp + wcslen (pp) - 1; /*(*/
120+ pe = glob_patscan_wc (pp, se, 0);
121+
122+ if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0)
123 {
124 *pe = L'\0';
125 r = wchkname (pp, dname); /*(*/
126 *pe = L')';
127 return r;
128 }
129+
130+ /* check every subpattern */
131 while (t = glob_patscan_wc (pp, pe, '|'))
132 {
133 n = t[-1];
134@@ -305,10 +316,8 @@
135 if (pp == pe) /* glob_patscan_wc might find end of pattern */
136 return r;
137
138- *pe = L'\0';
139- r = wchkname (pp, dname); /*(*/
140- *pe = L')';
141- return r;
142+ /* but if it doesn't then we didn't match a leading dot */
143+ return 0;
144 #else
145 return (wchkname (pat, dname));
146 #endif
147diff -Naur bash-4.3.orig/lib/glob/gmisc.c bash-4.3/lib/glob/gmisc.c
148--- bash-4.3.orig/lib/glob/gmisc.c 2013-10-28 13:45:25.000000000 -0500
149+++ bash-4.3/lib/glob/gmisc.c 2014-03-30 08:38:18.153657420 -0500
150@@ -210,6 +210,7 @@
151 case '+':
152 case '!':
153 case '@':
154+ case '?':
155 return (pat[1] == LPAREN);
156 default:
157 return 0;
158diff -Naur bash-4.3.orig/lib/readline/readline.c bash-4.3/lib/readline/readline.c
159--- bash-4.3.orig/lib/readline/readline.c 2013-10-28 13:58:06.000000000 -0500
160+++ bash-4.3/lib/readline/readline.c 2014-03-30 08:38:10.556751185 -0500
161@@ -744,7 +744,8 @@
162 r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
163
164 RL_CHECK_SIGNALS ();
165- if (r == 0) /* success! */
166+ /* We only treat values < 0 specially to simulate recursion. */
167+ if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */
168 {
169 _rl_keyseq_chain_dispose ();
170 RL_UNSETSTATE (RL_STATE_MULTIKEY);
171@@ -964,7 +965,7 @@
172 #if defined (VI_MODE)
173 if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
174 key != ANYOTHERKEY &&
175- rl_key_sequence_length == 1 && /* XXX */
176+ _rl_dispatching_keymap == vi_movement_keymap &&
177 _rl_vi_textmod_command (key))
178 _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
179 #endif
180diff -Naur bash-4.3.orig/parse.y bash-4.3/parse.y
181--- bash-4.3.orig/parse.y 2014-02-11 08:42:10.000000000 -0600
182+++ bash-4.3/parse.y 2014-03-30 08:38:12.463477417 -0500
183@@ -3398,7 +3398,7 @@
184 within a double-quoted ${...} construct "an even number of
185 unescaped double-quotes or single-quotes, if any, shall occur." */
186 /* This was changed in Austin Group Interp 221 */
187- if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
188+ if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
189 continue;
190
191 /* Could also check open == '`' if we want to parse grouping constructs
192diff -Naur bash-4.3.orig/patchlevel.h bash-4.3/patchlevel.h
193--- bash-4.3.orig/patchlevel.h 2012-12-29 09:47:57.000000000 -0600
194+++ bash-4.3/patchlevel.h 2014-03-30 08:38:18.153657420 -0500
195@@ -25,6 +25,6 @@
196 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
197 looks for to find the patch level (for the sccs version string). */
198
199-#define PATCHLEVEL 0
200+#define PATCHLEVEL 8
201
202 #endif /* _PATCHLEVEL_H_ */
203diff -Naur bash-4.3.orig/test.c bash-4.3/test.c
204--- bash-4.3.orig/test.c 2014-02-04 15:52:58.000000000 -0600
205+++ bash-4.3/test.c 2014-03-30 08:38:04.859903460 -0500
206@@ -646,8 +646,8 @@
207 return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE);
208
209 case 'R':
210- v = find_variable (arg);
211- return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);
212+ v = find_variable_noref (arg);
213+ return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE);
214 }
215
216 /* We can't actually get here, but this shuts up gcc. */
217@@ -723,6 +723,7 @@
218 case 'o': case 'p': case 'r': case 's': case 't':
219 case 'u': case 'v': case 'w': case 'x': case 'z':
220 case 'G': case 'L': case 'O': case 'S': case 'N':
221+ case 'R':
222 return (1);
223 }
224
225diff -Naur bash-4.3.orig/trap.c bash-4.3/trap.c
226--- bash-4.3.orig/trap.c 2014-02-05 09:03:21.000000000 -0600
227+++ bash-4.3/trap.c 2014-03-30 08:38:06.756626741 -0500
228@@ -920,7 +920,8 @@
229 subst_assign_varlist = 0;
230
231 #if defined (JOB_CONTROL)
232- save_pipeline (1); /* XXX only provides one save level */
233+ if (sig != DEBUG_TRAP) /* run_debug_trap does this */
234+ save_pipeline (1); /* XXX only provides one save level */
235 #endif
236
237 /* If we're in a function, make sure return longjmps come here, too. */
238@@ -940,7 +941,8 @@
239 trap_exit_value = last_command_exit_value;
240
241 #if defined (JOB_CONTROL)
242- restore_pipeline (1);
243+ if (sig != DEBUG_TRAP) /* run_debug_trap does this */
244+ restore_pipeline (1);
245 #endif
246
247 subst_assign_varlist = save_subst_varlist;
248diff -Naur bash-4.3.orig/y.tab.c bash-4.3/y.tab.c
249--- bash-4.3.orig/y.tab.c 2014-02-11 09:57:47.000000000 -0600
250+++ bash-4.3/y.tab.c 2014-03-30 08:38:12.463477417 -0500
251@@ -5710,7 +5710,7 @@
252 within a double-quoted ${...} construct "an even number of
253 unescaped double-quotes or single-quotes, if any, shall occur." */
254 /* This was changed in Austin Group Interp 221 */
255- if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
256+ if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
257 continue;
258
259 /* Could also check open == '`' if we want to parse grouping constructs
Note: See TracBrowser for help on using the repository browser.