python/types-pytz: update to 2024.2.0.20241221
[oi-userland.git] / components / shell / bash / patches / bash52-012.patch
blob2791542c96e073bde45f5b1c4350088d02aee5b4
1 BASH PATCH REPORT
2 =================
4 Bash-Release: 5.2
5 Patch-ID: bash52-012
7 Bug-Reported-by: Kerin Millar <kfm@plushkava.net>
8 Bug-Reference-ID: <20221002095107.89561bc811e549b55644df11@plushkava.net>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00001.html
11 Bug-Description:
13 When running in bash compatibility mode, nested command substitutions can
14 leave the `extglob' option enabled.
16 Patch (apply with `patch -p0'):
18 *** /fs1/chet/scratch/bash-5.2.12/builtins/shopt.def 2022-11-07 10:31:42.000000000 -0500
19 --- builtins/shopt.def 2022-10-14 09:30:11.000000000 -0400
20 ***************
21 *** 150,153 ****
22 --- 150,158 ----
23 #endif
25 + #if defined (EXTENDED_GLOB)
26 + int extglob_flag = EXTGLOB_DEFAULT;
27 + static int shopt_set_extglob PARAMS((char *, int));
28 + #endif
30 int expaliases_flag = 0;
31 static int shopt_set_expaliases PARAMS((char *, int));
32 ***************
33 *** 207,211 ****
34 #endif
35 #if defined (EXTENDED_GLOB)
36 ! { "extglob", &extended_glob, (shopt_set_func_t *)NULL },
37 #endif
38 { "extquote", &extended_quote, (shopt_set_func_t *)NULL },
39 --- 212,216 ----
40 #endif
41 #if defined (EXTENDED_GLOB)
42 ! { "extglob", &extglob_flag, shopt_set_extglob },
43 #endif
44 { "extquote", &extended_quote, (shopt_set_func_t *)NULL },
45 ***************
46 *** 378,382 ****
48 #if defined (EXTENDED_GLOB)
49 ! extended_glob = EXTGLOB_DEFAULT;
50 #endif
52 --- 383,387 ----
54 #if defined (EXTENDED_GLOB)
55 ! extended_glob = extglob_flag = EXTGLOB_DEFAULT;
56 #endif
58 ***************
59 *** 644,647 ****
60 --- 649,663 ----
63 + #if defined (EXTENDED_GLOB)
64 + static int
65 + shopt_set_extglob (option_name, mode)
66 + char *option_name;
67 + int mode;
68 + {
69 + extended_glob = extglob_flag;
70 + return 0;
71 + }
72 + #endif
74 #if defined (READLINE)
75 static int
76 *** /fs1/chet/scratch/bash-5.2.12/builtins/common.h 2022-11-07 10:31:42.000000000 -0500
77 --- builtins/common.h 2022-10-14 09:29:25.000000000 -0400
78 ***************
79 *** 258,261 ****
80 --- 258,265 ----
81 #endif
83 + #if defined (EXTENDED_GLOB)
84 + extern int extglob_flag;
85 + #endif
87 extern int expaliases_flag;
89 *** /fs1/chet/scratch/bash-5.2.12/execute_cmd.c 2022-11-07 10:31:42.000000000 -0500
90 --- execute_cmd.c 2022-11-02 16:32:12.000000000 -0400
91 ***************
92 *** 3991,4001 ****
93 #endif /* COND_REGEXP */
95 - int oe;
96 - oe = extended_glob;
97 extended_glob = 1;
98 result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE)
99 ? EXECUTION_SUCCESS
100 : EXECUTION_FAILURE;
101 ! extended_glob = oe;
103 if (arg1 != nullstr)
104 --- 4015,4023 ----
105 #endif /* COND_REGEXP */
107 extended_glob = 1;
108 result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE)
109 ? EXECUTION_SUCCESS
110 : EXECUTION_FAILURE;
111 ! extended_glob = extglob_flag;
113 if (arg1 != nullstr)
114 *** /fs1/chet/scratch/bash-5.2.9/parse.y 2022-11-07 10:31:47.000000000 -0500
115 --- parse.y 2022-11-14 11:27:22.000000000 -0500
116 ***************
117 *** 126,130 ****
119 #if defined (EXTENDED_GLOB)
120 ! extern int extended_glob;
121 #endif
123 --- 126,130 ----
125 #if defined (EXTENDED_GLOB)
126 ! extern int extended_glob, extglob_flag;
127 #endif
129 ***************
130 *** 3305,3309 ****
131 /* Reset to global value of extended glob */
132 if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
133 ! extended_glob = global_extglob;
134 #endif
135 if (parser_state & (PST_CMDSUBST|PST_STRING))
136 --- 3321,3325 ----
137 /* Reset to global value of extended glob */
138 if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
139 ! extended_glob = extglob_flag;
140 #endif
141 if (parser_state & (PST_CMDSUBST|PST_STRING))
142 ***************
143 *** 4125,4132 ****
144 #if defined (EXTENDED_GLOB)
145 /* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
146 ! conditional command and have already set global_extglob appropriately. */
147 if (shell_compatibility_level <= 51 && was_extpat == 0)
149 ! local_extglob = global_extglob = extended_glob;
150 extended_glob = 1;
152 --- 4143,4150 ----
153 #if defined (EXTENDED_GLOB)
154 /* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
155 ! conditional command and have already set extended_glob appropriately. */
156 if (shell_compatibility_level <= 51 && was_extpat == 0)
158 ! local_extglob = extended_glob;
159 extended_glob = 1;
161 ***************
162 *** 4236,4240 ****
163 sh_parser_state_t ps;
164 sh_input_line_state_t ls;
165 ! int orig_ind, nc, sflags, start_lineno;
166 char *ret, *ep, *ostring;
168 --- 4256,4260 ----
169 sh_parser_state_t ps;
170 sh_input_line_state_t ls;
171 ! int orig_ind, nc, sflags, start_lineno, local_extglob;
172 char *ret, *ep, *ostring;
174 ***************
175 *** 4279,4283 ****
176 expand_aliases = 0;
177 #if defined (EXTENDED_GLOB)
178 ! global_extglob = extended_glob; /* for reset_parser() */
179 #endif
181 --- 4299,4303 ----
182 expand_aliases = 0;
183 #if defined (EXTENDED_GLOB)
184 ! local_extglob = extended_glob;
185 #endif
187 ***************
188 *** 4297,4300 ****
189 --- 4317,4323 ----
190 restore_parser_state (&ps);
192 + #if defined (EXTENDED_GLOB)
193 + extended_glob = local_extglob;
194 + #endif
195 token_to_read = 0;
197 ***************
198 *** 4732,4741 ****
199 --- 4755,4768 ----
201 /* rhs */
202 + #if defined (EXTENDED_GLOB)
203 local_extglob = extended_glob;
204 if (parser_state & PST_EXTPAT)
205 extended_glob = 1;
206 + #endif
207 tok = read_token (READ);
208 + #if defined (EXTENDED_GLOB)
209 if (parser_state & PST_EXTPAT)
210 extended_glob = local_extglob;
211 + #endif
212 parser_state &= ~(PST_REGEXP|PST_EXTPAT);
214 ***************
215 *** 4784,4788 ****
216 COND_COM *cexp;
218 - global_extglob = extended_glob;
219 cexp = cond_expr ();
220 return (make_cond_command (cexp));
221 --- 4811,4814 ----
222 *** y.tab.c.save 2022-11-07 10:31:47.000000000 -0500
223 --- y.tab.c 2022-11-18 15:58:03.000000000 -0500
224 ***************
225 *** 176,180 ****
227 #if defined (EXTENDED_GLOB)
228 ! extern int extended_glob;
229 #endif
231 --- 176,180 ----
233 #if defined (EXTENDED_GLOB)
234 ! extern int extended_glob, extglob_flag;
235 #endif
237 ***************
238 *** 5616,5620 ****
239 /* Reset to global value of extended glob */
240 if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
241 ! extended_glob = global_extglob;
242 #endif
243 if (parser_state & (PST_CMDSUBST|PST_STRING))
244 --- 5616,5620 ----
245 /* Reset to global value of extended glob */
246 if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
247 ! extended_glob = extglob_flag;
248 #endif
249 if (parser_state & (PST_CMDSUBST|PST_STRING))
250 ***************
251 *** 6436,6443 ****
252 #if defined (EXTENDED_GLOB)
253 /* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
254 ! conditional command and have already set global_extglob appropriately. */
255 if (shell_compatibility_level <= 51 && was_extpat == 0)
257 ! local_extglob = global_extglob = extended_glob;
258 extended_glob = 1;
260 --- 6436,6443 ----
261 #if defined (EXTENDED_GLOB)
262 /* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
263 ! conditional command and have already set extended_glob appropriately. */
264 if (shell_compatibility_level <= 51 && was_extpat == 0)
266 ! local_extglob = extended_glob;
267 extended_glob = 1;
269 ***************
270 *** 6547,6551 ****
271 sh_parser_state_t ps;
272 sh_input_line_state_t ls;
273 ! int orig_ind, nc, sflags, start_lineno;
274 char *ret, *ep, *ostring;
276 --- 6547,6551 ----
277 sh_parser_state_t ps;
278 sh_input_line_state_t ls;
279 ! int orig_ind, nc, sflags, start_lineno, local_extglob;
280 char *ret, *ep, *ostring;
282 ***************
283 *** 6590,6594 ****
284 expand_aliases = 0;
285 #if defined (EXTENDED_GLOB)
286 ! global_extglob = extended_glob; /* for reset_parser() */
287 #endif
289 --- 6590,6594 ----
290 expand_aliases = 0;
291 #if defined (EXTENDED_GLOB)
292 ! local_extglob = extended_glob;
293 #endif
295 ***************
296 *** 6608,6611 ****
297 --- 6608,6614 ----
298 restore_parser_state (&ps);
300 + #if defined (EXTENDED_GLOB)
301 + extended_glob = local_extglob;
302 + #endif
303 token_to_read = 0;
305 ***************
306 *** 7043,7052 ****
307 --- 7046,7059 ----
309 /* rhs */
310 + #if defined (EXTENDED_GLOB)
311 local_extglob = extended_glob;
312 if (parser_state & PST_EXTPAT)
313 extended_glob = 1;
314 + #endif
315 tok = read_token (READ);
316 + #if defined (EXTENDED_GLOB)
317 if (parser_state & PST_EXTPAT)
318 extended_glob = local_extglob;
319 + #endif
320 parser_state &= ~(PST_REGEXP|PST_EXTPAT);
322 ***************
323 *** 7095,7099 ****
324 COND_COM *cexp;
326 - global_extglob = extended_glob;
327 cexp = cond_expr ();
328 return (make_cond_command (cexp));
329 --- 7102,7105 ----
330 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
331 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
332 ***************
333 *** 26,30 ****
334 looks for to find the patch level (for the sccs version string). */
336 ! #define PATCHLEVEL 11
338 #endif /* _PATCHLEVEL_H_ */
339 --- 26,30 ----
340 looks for to find the patch level (for the sccs version string). */
342 ! #define PATCHLEVEL 12
344 #endif /* _PATCHLEVEL_H_ */