Fix building evolution-data-server with cmake-3.20.1
[linux_from_scratch_patches.git] / bash / bash-4.3-upstream_fixes-7.patch
blobe69106d2baa3f0944a7f9418a009e00e3b62033f
1 Submitted By: Bruce Dubbs <bdubbs_at_linuxfromscratch_dot_org>
2 Updated By: Armin K. <krejzi at email dot com>
3 Date: 2014-10-11
4 Initial Package Version: 4.3
5 Upstream Status: Already in upstream patch repo
6 Origin: Upstream
7 Description: This patch contains upstream patch numbers 001 thru 030
8 and fixes for CVE-2014-6271, CVE-2014-6277, CVE-2014-6278,
9 CVE-2014-7169, and CVE-2014-7187
11 --- a/arrayfunc.c 2013-08-02 22:19:59.000000000 +0200
12 +++ b/arrayfunc.c 2014-10-11 10:34:38.173610936 +0200
13 @@ -179,6 +179,7 @@
14 array_insert (array_cell (entry), ind, newval);
15 FREE (newval);
17 + VUNSETATTR (entry, att_invisible); /* no longer invisible */
18 return (entry);
21 @@ -597,6 +598,11 @@
22 if (assoc_p (var))
24 val = expand_assignment_string_to_string (val, 0);
25 + if (val == 0)
26 + {
27 + val = (char *)xmalloc (1);
28 + val[0] = '\0'; /* like do_assignment_internal */
29 + }
30 free_val = 1;
33 --- a/bashline.c 2014-02-10 01:56:58.000000000 +0100
34 +++ b/bashline.c 2014-10-11 10:34:38.173610936 +0200
35 @@ -4167,9 +4167,16 @@
36 int qc;
38 qc = rl_dispatching ? rl_completion_quote_character : 0;
39 - dfn = bash_dequote_filename ((char *)text, qc);
40 + /* If rl_completion_found_quote != 0, rl_completion_matches will call the
41 + filename dequoting function, causing the directory name to be dequoted
42 + twice. */
43 + if (rl_dispatching && rl_completion_found_quote == 0)
44 + dfn = bash_dequote_filename ((char *)text, qc);
45 + else
46 + dfn = (char *)text;
47 m1 = rl_completion_matches (dfn, rl_filename_completion_function);
48 - free (dfn);
49 + if (dfn != text)
50 + free (dfn);
52 if (m1 == 0 || m1[0] == 0)
53 return m1;
54 --- a/builtins/common.h 2013-07-08 22:54:47.000000000 +0200
55 +++ b/builtins/common.h 2014-10-11 10:34:38.174610956 +0200
56 @@ -33,6 +33,8 @@
57 #define SEVAL_RESETLINE 0x010
58 #define SEVAL_PARSEONLY 0x020
59 #define SEVAL_NOLONGJMP 0x040
60 +#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */
61 +#define SEVAL_ONECMD 0x100 /* only allow a single command */
63 /* Flags for describe_command, shared between type.def and command.def */
64 #define CDESC_ALL 0x001 /* type -a */
65 --- a/builtins/evalstring.c 2014-02-11 15:42:10.000000000 +0100
66 +++ b/builtins/evalstring.c 2014-10-11 10:37:09.625510026 +0200
67 @@ -308,6 +308,27 @@
69 struct fd_bitmap *bitmap;
71 + if (flags & SEVAL_FUNCDEF)
72 + {
73 + char *x;
75 + /* If the command parses to something other than a straight
76 + function definition, or if we have not consumed the entire
77 + string, or if the parser has transformed the function
78 + name (as parsing will if it begins or ends with shell
79 + whitespace, for example), reject the attempt */
80 + if (command->type != cm_function_def ||
81 + ((x = parser_remaining_input ()) && *x) ||
82 + (STREQ (from_file, command->value.Function_def->name->word) == 0))
83 + {
84 + internal_warning (_("%s: ignoring function definition attempt"), from_file);
85 + should_jump_to_top_level = 0;
86 + last_result = last_command_exit_value = EX_BADUSAGE;
87 + reset_parser ();
88 + break;
89 + }
90 + }
92 bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
93 begin_unwind_frame ("pe_dispose");
94 add_unwind_protect (dispose_fd_bitmap, bitmap);
95 @@ -368,6 +389,12 @@
96 dispose_command (command);
97 dispose_fd_bitmap (bitmap);
98 discard_unwind_frame ("pe_dispose");
100 + if (flags & SEVAL_ONECMD)
102 + reset_parser ();
103 + break;
107 else
108 --- a/builtins/read.def 2013-09-02 17:54:00.000000000 +0200
109 +++ b/builtins/read.def 2014-10-11 10:34:38.174610956 +0200
110 @@ -442,7 +442,10 @@
111 add_unwind_protect (reset_alarm, (char *)NULL);
112 #if defined (READLINE)
113 if (edit)
114 - add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
116 + add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
117 + add_unwind_protect (bashline_reset_event_hook, (char *)NULL);
119 #endif
120 falarm (tmsec, tmusec);
122 @@ -1021,6 +1024,7 @@
124 old_attempted_completion_function = rl_attempted_completion_function;
125 rl_attempted_completion_function = (rl_completion_func_t *)NULL;
126 + bashline_set_event_hook ();
127 if (itext)
129 old_startup_hook = rl_startup_hook;
130 @@ -1032,6 +1036,7 @@
132 rl_attempted_completion_function = old_attempted_completion_function;
133 old_attempted_completion_function = (rl_completion_func_t *)NULL;
134 + bashline_reset_event_hook ();
136 if (ret == 0)
137 return ret;
138 --- a/copy_cmd.c 2009-09-11 22:28:02.000000000 +0200
139 +++ b/copy_cmd.c 2014-10-11 10:34:38.174610956 +0200
140 @@ -126,7 +126,7 @@
142 case r_reading_until:
143 case r_deblank_reading_until:
144 - new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
145 + new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
146 /*FALLTHROUGH*/
147 case r_reading_string:
148 case r_appending_to:
149 --- a/execute_cmd.c 2014-01-31 16:54:52.000000000 +0100
150 +++ b/execute_cmd.c 2014-10-11 10:34:38.175610976 +0200
151 @@ -2409,7 +2409,16 @@
152 #endif
153 lstdin = wait_for (lastpid);
154 #if defined (JOB_CONTROL)
155 - exec_result = job_exit_status (lastpipe_jid);
156 + /* If wait_for removes the job from the jobs table, use result of last
157 + command as pipeline's exit status as usual. The jobs list can get
158 + frozen and unfrozen at inconvenient times if there are multiple pipelines
159 + running simultaneously. */
160 + if (INVALID_JOB (lastpipe_jid) == 0)
161 + exec_result = job_exit_status (lastpipe_jid);
162 + else if (pipefail_opt)
163 + exec_result = exec_result | lstdin; /* XXX */
164 + /* otherwise we use exec_result */
166 #endif
167 unfreeze_jobs_list ();
169 --- a/externs.h 2014-01-02 20:58:20.000000000 +0100
170 +++ b/externs.h 2014-10-11 10:34:38.175610976 +0200
171 @@ -324,6 +324,7 @@
172 extern char *sh_backslash_quote __P((char *, const char *, int));
173 extern char *sh_backslash_quote_for_double_quotes __P((char *));
174 extern int sh_contains_shell_metas __P((char *));
175 +extern int sh_contains_quotes __P((char *));
177 /* declarations for functions defined in lib/sh/spell.c */
178 extern int spname __P((char *, char *));
179 --- a/jobs.c 2014-01-10 15:05:34.000000000 +0100
180 +++ b/jobs.c 2014-10-11 10:34:38.176610995 +0200
181 @@ -3597,6 +3597,7 @@
182 unwind_protect_int (jobs_list_frozen);
183 unwind_protect_pointer (the_pipeline);
184 unwind_protect_pointer (subst_assign_varlist);
185 + unwind_protect_pointer (this_shell_builtin);
187 /* We have to add the commands this way because they will be run
188 in reverse order of adding. We don't want maybe_set_sigchld_trap ()
189 @@ -4374,7 +4375,7 @@
190 void
191 end_job_control ()
193 - if (interactive_shell) /* XXX - should it be interactive? */
194 + if (interactive_shell || job_control) /* XXX - should it be just job_control? */
196 terminate_stopped_jobs ();
198 --- a/lib/glob/glob.c 2014-02-01 03:43:51.000000000 +0100
199 +++ b/lib/glob/glob.c 2014-10-11 10:34:38.176610995 +0200
200 @@ -123,6 +123,8 @@
201 extern char *glob_patscan __P((char *, char *, int));
202 extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int));
204 +extern char *glob_dirscan __P((char *, int));
206 /* Compile `glob_loop.c' for single-byte characters. */
207 #define CHAR unsigned char
208 #define INT int
209 @@ -179,42 +181,53 @@
210 char *pat, *dname;
211 int flags;
213 - char *pp, *pe, *t;
214 - int n, r;
215 + char *pp, *pe, *t, *se;
216 + int n, r, negate;
218 + negate = *pat == '!';
219 pp = pat + 2;
220 - pe = pp + strlen (pp) - 1; /*(*/
221 - if (*pe != ')')
222 + se = pp + strlen (pp) - 1; /* end of string */
223 + pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */
224 + /* we should check for invalid extglob pattern here */
225 + if (pe == 0)
226 return 0;
227 - if ((t = strchr (pp, '|')) == 0) /* easy case first */
229 + /* if pe != se we have more of the pattern at the end of the extglob
230 + pattern. Check the easy case first ( */
231 + if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
233 *pe = '\0';
234 +#if defined (HANDLE_MULTIBYTE)
235 + r = mbskipname (pp, dname, flags);
236 +#else
237 r = skipname (pp, dname, flags); /*(*/
238 +#endif
239 *pe = ')';
240 return r;
243 + /* check every subpattern */
244 while (t = glob_patscan (pp, pe, '|'))
246 n = t[-1];
247 t[-1] = '\0';
248 +#if defined (HANDLE_MULTIBYTE)
249 + r = mbskipname (pp, dname, flags);
250 +#else
251 r = skipname (pp, dname, flags);
252 +#endif
253 t[-1] = n;
254 if (r == 0) /* if any pattern says not skip, we don't skip */
255 return r;
256 pp = t;
257 } /*(*/
259 - if (pp == pe) /* glob_patscan might find end of pattern */
260 + /* glob_patscan might find end of pattern */
261 + if (pp == se)
262 return r;
264 - *pe = '\0';
265 -# if defined (HANDLE_MULTIBYTE)
266 - r = mbskipname (pp, dname, flags); /*(*/
267 -# else
268 - r = skipname (pp, dname, flags); /*(*/
269 -# endif
270 - *pe = ')';
271 - return r;
272 + /* but if it doesn't then we didn't match a leading dot */
273 + return 0;
275 #endif
277 @@ -277,20 +290,23 @@
278 int flags;
280 #if EXTENDED_GLOB
281 - wchar_t *pp, *pe, *t, n;
282 - int r;
283 + wchar_t *pp, *pe, *t, n, *se;
284 + int r, negate;
286 + negate = *pat == L'!';
287 pp = pat + 2;
288 - pe = pp + wcslen (pp) - 1; /*(*/
289 - if (*pe != L')')
290 - return 0;
291 - if ((t = wcschr (pp, L'|')) == 0)
292 + se = pp + wcslen (pp) - 1; /*(*/
293 + pe = glob_patscan_wc (pp, se, 0);
295 + if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0)
297 *pe = L'\0';
298 r = wchkname (pp, dname); /*(*/
299 *pe = L')';
300 return r;
303 + /* check every subpattern */
304 while (t = glob_patscan_wc (pp, pe, '|'))
306 n = t[-1];
307 @@ -305,10 +321,8 @@
308 if (pp == pe) /* glob_patscan_wc might find end of pattern */
309 return r;
311 - *pe = L'\0';
312 - r = wchkname (pp, dname); /*(*/
313 - *pe = L')';
314 - return r;
315 + /* but if it doesn't then we didn't match a leading dot */
316 + return 0;
317 #else
318 return (wchkname (pat, dname));
319 #endif
320 @@ -1006,7 +1020,7 @@
322 char **result;
323 unsigned int result_size;
324 - char *directory_name, *filename, *dname;
325 + char *directory_name, *filename, *dname, *fn;
326 unsigned int directory_len;
327 int free_dirname; /* flag */
328 int dflags;
329 @@ -1022,6 +1036,18 @@
331 /* Find the filename. */
332 filename = strrchr (pathname, '/');
333 +#if defined (EXTENDED_GLOB)
334 + if (filename && extended_glob)
336 + fn = glob_dirscan (pathname, '/');
337 +#if DEBUG_MATCHING
338 + if (fn != filename)
339 + fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename);
340 +#endif
341 + filename = fn;
343 +#endif
345 if (filename == NULL)
347 filename = pathname;
348 --- a/lib/glob/gmisc.c 2013-10-28 19:45:25.000000000 +0100
349 +++ b/lib/glob/gmisc.c 2014-10-11 10:34:38.176610995 +0200
350 @@ -42,6 +42,8 @@
351 #define WLPAREN L'('
352 #define WRPAREN L')'
354 +extern char *glob_patscan __P((char *, char *, int));
356 /* Return 1 of the first character of WSTRING could match the first
357 character of pattern WPAT. Wide character version. */
359 @@ -210,6 +212,7 @@
360 case '+':
361 case '!':
362 case '@':
363 + case '?':
364 return (pat[1] == LPAREN);
365 default:
366 return 0;
367 @@ -374,3 +377,34 @@
369 return matlen;
372 +/* Skip characters in PAT and return the final occurrence of DIRSEP. This
373 + is only called when extended_glob is set, so we have to skip over extglob
374 + patterns x(...) */
375 +char *
376 +glob_dirscan (pat, dirsep)
377 + char *pat;
378 + int dirsep;
380 + char *p, *d, *pe, *se;
382 + d = pe = se = 0;
383 + for (p = pat; p && *p; p++)
385 + if (extglob_pattern_p (p))
387 + if (se == 0)
388 + se = p + strlen (p) - 1;
389 + pe = glob_patscan (p + 2, se, 0);
390 + if (pe == 0)
391 + continue;
392 + else if (*pe == 0)
393 + break;
394 + p = pe - 1; /* will do increment above */
395 + continue;
397 + if (*p == dirsep)
398 + d = p;
400 + return d;
402 --- a/lib/readline/display.c 2013-12-27 19:10:56.000000000 +0100
403 +++ b/lib/readline/display.c 2014-10-11 10:34:38.177611015 +0200
404 @@ -1637,7 +1637,7 @@
405 /* If we are changing the number of invisible characters in a line, and
406 the spot of first difference is before the end of the invisible chars,
407 lendiff needs to be adjusted. */
408 - if (current_line == 0 && !_rl_horizontal_scroll_mode &&
409 + if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
410 current_invis_chars != visible_wrap_offset)
412 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
413 @@ -1825,8 +1825,13 @@
414 else
415 _rl_last_c_pos += bytes_to_insert;
417 + /* XXX - we only want to do this if we are at the end of the line
418 + so we move there with _rl_move_cursor_relative */
419 if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new)))
420 - goto clear_rest_of_line;
422 + _rl_move_cursor_relative (ne-new, new);
423 + goto clear_rest_of_line;
427 /* Otherwise, print over the existing material. */
428 @@ -2677,7 +2682,8 @@
430 if (_rl_echoing_p)
432 - _rl_move_vert (_rl_vis_botlin);
433 + if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */
434 + _rl_move_vert (_rl_vis_botlin);
435 _rl_vis_botlin = 0;
436 fflush (rl_outstream);
437 rl_restart_output (1, 0);
438 --- a/lib/readline/input.c 2014-01-10 21:07:08.000000000 +0100
439 +++ b/lib/readline/input.c 2014-10-11 10:34:38.177611015 +0200
440 @@ -534,8 +534,16 @@
441 return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
442 else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
443 return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
444 + /* keyboard-generated signals of interest */
445 else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT)
446 RL_CHECK_SIGNALS ();
447 + /* non-keyboard-generated signals of interest */
448 + else if (_rl_caught_signal == SIGALRM
449 +#if defined (SIGVTALRM)
450 + || _rl_caught_signal == SIGVTALRM
451 +#endif
453 + RL_CHECK_SIGNALS ();
455 if (rl_signal_event_hook)
456 (*rl_signal_event_hook) ();
457 --- a/lib/readline/misc.c 2012-09-02 00:03:11.000000000 +0200
458 +++ b/lib/readline/misc.c 2014-10-11 10:34:38.177611015 +0200
459 @@ -461,6 +461,7 @@
460 saved_undo_list = 0;
461 /* Set up rl_line_buffer and other variables from history entry */
462 rl_replace_from_history (entry, 0); /* entry->line is now current */
463 + entry->data = 0; /* entry->data is now current undo list */
464 /* Undo all changes to this history entry */
465 while (rl_undo_list)
466 rl_do_undo ();
467 @@ -468,7 +469,6 @@
468 the timestamp. */
469 FREE (entry->line);
470 entry->line = savestring (rl_line_buffer);
471 - entry->data = 0;
473 entry = previous_history ();
475 --- a/lib/readline/readline.c 2013-10-28 19:58:06.000000000 +0100
476 +++ b/lib/readline/readline.c 2014-10-11 10:34:38.177611015 +0200
477 @@ -744,7 +744,8 @@
478 r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
480 RL_CHECK_SIGNALS ();
481 - if (r == 0) /* success! */
482 + /* We only treat values < 0 specially to simulate recursion. */
483 + if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */
485 _rl_keyseq_chain_dispose ();
486 RL_UNSETSTATE (RL_STATE_MULTIKEY);
487 @@ -964,7 +965,7 @@
488 #if defined (VI_MODE)
489 if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
490 key != ANYOTHERKEY &&
491 - rl_key_sequence_length == 1 && /* XXX */
492 + _rl_dispatching_keymap == vi_movement_keymap &&
493 _rl_vi_textmod_command (key))
494 _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
495 #endif
496 --- a/lib/sh/shquote.c 2013-04-01 03:53:32.000000000 +0200
497 +++ b/lib/sh/shquote.c 2014-10-11 10:34:38.177611015 +0200
498 @@ -311,3 +311,17 @@
500 return (0);
503 +int
504 +sh_contains_quotes (string)
505 + char *string;
507 + char *s;
509 + for (s = string; s && *s; s++)
511 + if (*s == '\'' || *s == '"' || *s == '\\')
512 + return 1;
514 + return 0;
516 --- a/make_cmd.c 2011-12-16 14:08:01.000000000 +0100
517 +++ b/make_cmd.c 2014-10-11 10:34:38.178611034 +0200
518 @@ -692,6 +692,7 @@
519 /* First do the common cases. */
520 temp->redirector = source;
521 temp->redirectee = dest_and_filename;
522 + temp->here_doc_eof = 0;
523 temp->instruction = instruction;
524 temp->flags = 0;
525 temp->rflags = flags;
526 --- a/parse.y 2014-02-11 15:42:10.000000000 +0100
527 +++ b/parse.y 2014-10-11 10:37:09.626510045 +0200
528 @@ -168,6 +168,9 @@
530 static int reserved_word_acceptable __P((int));
531 static int yylex __P((void));
533 +static void push_heredoc __P((REDIRECT *));
534 +static char *mk_alexpansion __P((char *));
535 static int alias_expand_token __P((char *));
536 static int time_command_acceptable __P((void));
537 static int special_case_tokens __P((char *));
538 @@ -265,7 +268,9 @@
540 /* Variables to manage the task of reading here documents, because we need to
541 defer the reading until after a complete command has been collected. */
542 -static REDIRECT *redir_stack[10];
543 +#define HEREDOC_MAX 16
545 +static REDIRECT *redir_stack[HEREDOC_MAX];
546 int need_here_doc;
548 /* Where shell input comes from. History expansion is performed on each
549 @@ -307,7 +312,7 @@
550 or `for WORD' begins. This is a nested command maximum, since the array
551 index is decremented after a case, select, or for command is parsed. */
552 #define MAX_CASE_NEST 128
553 -static int word_lineno[MAX_CASE_NEST];
554 +static int word_lineno[MAX_CASE_NEST+1];
555 static int word_top = -1;
557 /* If non-zero, it is the token that we want read_token to return
558 @@ -520,42 +525,42 @@
559 source.dest = 0;
560 redir.filename = $2;
561 $$ = make_redirection (source, r_reading_until, redir, 0);
562 - redir_stack[need_here_doc++] = $$;
563 + push_heredoc ($$);
565 | NUMBER LESS_LESS WORD
567 source.dest = $1;
568 redir.filename = $3;
569 $$ = make_redirection (source, r_reading_until, redir, 0);
570 - redir_stack[need_here_doc++] = $$;
571 + push_heredoc ($$);
573 | REDIR_WORD LESS_LESS WORD
575 source.filename = $1;
576 redir.filename = $3;
577 $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
578 - redir_stack[need_here_doc++] = $$;
579 + push_heredoc ($$);
581 | LESS_LESS_MINUS WORD
583 source.dest = 0;
584 redir.filename = $2;
585 $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
586 - redir_stack[need_here_doc++] = $$;
587 + push_heredoc ($$);
589 | NUMBER LESS_LESS_MINUS WORD
591 source.dest = $1;
592 redir.filename = $3;
593 $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
594 - redir_stack[need_here_doc++] = $$;
595 + push_heredoc ($$);
597 | REDIR_WORD LESS_LESS_MINUS WORD
599 source.filename = $1;
600 redir.filename = $3;
601 $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
602 - redir_stack[need_here_doc++] = $$;
603 + push_heredoc ($$);
605 | LESS_LESS_LESS WORD
607 @@ -2424,7 +2429,7 @@
608 not already end in an EOF character. */
609 if (shell_input_line_terminator != EOF)
611 - if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
612 + if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
613 shell_input_line = (char *)xrealloc (shell_input_line,
614 1 + (shell_input_line_size += 2));
616 @@ -2533,6 +2538,16 @@
617 eol_ungetc_lookahead = c;
620 +char *
621 +parser_remaining_input ()
623 + if (shell_input_line == 0)
624 + return 0;
625 + if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
626 + return '\0'; /* XXX */
627 + return (shell_input_line + shell_input_line_index);
630 #ifdef INCLUDE_UNUSED
631 /* Back the input pointer up by one, effectively `ungetting' a character. */
632 static void
633 @@ -2636,13 +2651,28 @@
634 which allow ESAC to be the next one read. */
635 static int esacs_needed_count;
637 +static void
638 +push_heredoc (r)
639 + REDIRECT *r;
641 + if (need_here_doc >= HEREDOC_MAX)
643 + last_command_exit_value = EX_BADUSAGE;
644 + need_here_doc = 0;
645 + report_syntax_error (_("maximum here-document count exceeded"));
646 + reset_parser ();
647 + exit_shell (last_command_exit_value);
649 + redir_stack[need_here_doc++] = r;
652 void
653 gather_here_documents ()
655 int r;
657 r = 0;
658 - while (need_here_doc)
659 + while (need_here_doc > 0)
661 parser_state |= PST_HEREDOC;
662 make_here_document (redir_stack[r++], line_number);
663 @@ -2953,6 +2983,8 @@
664 FREE (word_desc_to_read);
665 word_desc_to_read = (WORD_DESC *)NULL;
667 + eol_ungetc_lookahead = 0;
669 current_token = '\n'; /* XXX */
670 last_read_token = '\n';
671 token_to_read = '\n';
672 @@ -3398,7 +3430,7 @@
673 within a double-quoted ${...} construct "an even number of
674 unescaped double-quotes or single-quotes, if any, shall occur." */
675 /* This was changed in Austin Group Interp 221 */
676 - if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
677 + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
678 continue;
680 /* Could also check open == '`' if we want to parse grouping constructs
681 @@ -4005,8 +4037,8 @@
682 reset_parser ();
683 /* reset_parser clears shell_input_line and associated variables */
684 restore_input_line_state (&ls);
685 - if (interactive)
686 - token_to_read = 0;
688 + token_to_read = 0;
690 /* Need to find how many characters parse_and_execute consumed, update
691 *indp, if flags != 0, copy the portion of the string parsed into RET
692 @@ -6075,6 +6107,7 @@
694 ps->expand_aliases = expand_aliases;
695 ps->echo_input_at_read = echo_input_at_read;
696 + ps->need_here_doc = need_here_doc;
698 ps->token = token;
699 ps->token_buffer_size = token_buffer_size;
700 @@ -6123,6 +6156,7 @@
702 expand_aliases = ps->expand_aliases;
703 echo_input_at_read = ps->echo_input_at_read;
704 + need_here_doc = ps->need_here_doc;
706 FREE (token);
707 token = ps->token;
708 --- a/patchlevel.h 2012-12-29 16:47:57.000000000 +0100
709 +++ b/patchlevel.h 2014-10-11 10:37:09.628510082 +0200
710 @@ -25,6 +25,6 @@
711 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
712 looks for to find the patch level (for the sccs version string). */
714 -#define PATCHLEVEL 0
715 +#define PATCHLEVEL 30
717 #endif /* _PATCHLEVEL_H_ */
718 --- a/pcomplete.c 2013-08-26 21:23:45.000000000 +0200
719 +++ b/pcomplete.c 2014-10-11 10:34:38.179611054 +0200
720 @@ -183,6 +183,7 @@
722 COMPSPEC *pcomp_curcs;
723 const char *pcomp_curcmd;
724 +const char *pcomp_curtxt;
726 #ifdef DEBUG
727 /* Debugging code */
728 @@ -753,6 +754,32 @@
729 quoted strings. */
730 dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
732 + /* Intended to solve a mismatched assumption by bash-completion. If
733 + the text to be completed is empty, but bash-completion turns it into
734 + a quoted string ('') assuming that this code will dequote it before
735 + calling readline, do the dequoting. */
736 + else if (iscompgen && iscompleting &&
737 + pcomp_curtxt && *pcomp_curtxt == 0 &&
738 + text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 &&
739 + rl_filename_dequoting_function)
740 + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
741 + /* Another mismatched assumption by bash-completion. If compgen is being
742 + run as part of bash-completion, and the argument to compgen is not
743 + the same as the word originally passed to the programmable completion
744 + code, dequote the argument if it has quote characters. It's an
745 + attempt to detect when bash-completion is quoting its filename
746 + argument before calling compgen. */
747 + /* We could check whether gen_shell_function_matches is in the call
748 + stack by checking whether the gen-shell-function-matches tag is in
749 + the unwind-protect stack, but there's no function to do that yet.
750 + We could simply check whether we're executing in a function by
751 + checking variable_context, and may end up doing that. */
752 + else if (iscompgen && iscompleting && rl_filename_dequoting_function &&
753 + pcomp_curtxt && text &&
754 + STREQ (pcomp_curtxt, text) == 0 &&
755 + variable_context &&
756 + sh_contains_quotes (text)) /* guess */
757 + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
758 else
759 dfn = savestring (text);
761 @@ -1522,7 +1549,7 @@
762 COMPSPEC **lastcs;
764 COMPSPEC *cs, *oldcs;
765 - const char *oldcmd;
766 + const char *oldcmd, *oldtxt;
767 STRINGLIST *ret;
769 cs = progcomp_search (ocmd);
770 @@ -1545,14 +1572,17 @@
772 oldcs = pcomp_curcs;
773 oldcmd = pcomp_curcmd;
774 + oldtxt = pcomp_curtxt;
776 pcomp_curcs = cs;
777 pcomp_curcmd = cmd;
778 + pcomp_curtxt = word;
780 ret = gen_compspec_completions (cs, cmd, word, start, end, foundp);
782 pcomp_curcs = oldcs;
783 pcomp_curcmd = oldcmd;
784 + pcomp_curtxt = oldtxt;
786 /* We need to conditionally handle setting *retryp here */
787 if (retryp)
788 --- a/shell.h 2012-12-26 03:11:01.000000000 +0100
789 +++ b/shell.h 2014-10-11 10:37:09.626510045 +0200
790 @@ -168,7 +168,8 @@
791 /* flags state affecting the parser */
792 int expand_aliases;
793 int echo_input_at_read;
795 + int need_here_doc;
797 } sh_parser_state_t;
799 typedef struct _sh_input_line_state_t {
800 @@ -179,6 +180,8 @@
801 } sh_input_line_state_t;
803 /* Let's try declaring these here. */
804 +extern char *parser_remaining_input __P((void));
806 extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *));
807 extern void restore_parser_state __P((sh_parser_state_t *));
809 --- a/subst.c 2014-01-23 22:26:37.000000000 +0100
810 +++ b/subst.c 2014-10-11 10:34:38.180611073 +0200
811 @@ -1192,12 +1192,18 @@
812 Start extracting at (SINDEX) as if we had just seen "<(".
813 Make (SINDEX) get the position of the matching ")". */ /*))*/
814 char *
815 -extract_process_subst (string, starter, sindex)
816 +extract_process_subst (string, starter, sindex, xflags)
817 char *string;
818 char *starter;
819 int *sindex;
820 + int xflags;
822 +#if 0
823 return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND));
824 +#else
825 + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0);
826 + return (xparse_dolparen (string, string+*sindex, sindex, xflags));
827 +#endif
829 #endif /* PROCESS_SUBSTITUTION */
831 @@ -1785,7 +1791,7 @@
832 si = i + 2;
833 if (string[si] == '\0')
834 CQ_RETURN(si);
835 - temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si);
836 + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0);
837 free (temp); /* no SX_ALLOC here */
838 i = si;
839 if (string[i] == '\0')
840 @@ -3248,8 +3254,10 @@
841 if (w->word == 0 || w->word[0] == '\0')
842 return ((char *)NULL);
844 + expand_no_split_dollar_star = 1;
845 w->flags |= W_NOSPLIT2;
846 l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0);
847 + expand_no_split_dollar_star = 0;
848 if (l)
850 if (special == 0) /* LHS */
851 @@ -7366,7 +7374,13 @@
854 if (want_indir)
855 - tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at);
857 + tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at);
858 + /* Turn off the W_ARRAYIND flag because there is no way for this function
859 + to return the index we're supposed to be using. */
860 + if (tdesc && tdesc->flags)
861 + tdesc->flags &= ~W_ARRAYIND;
863 else
864 tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind);
866 @@ -7847,6 +7861,10 @@
867 We also want to make sure that splitting is done no matter what --
868 according to POSIX.2, this expands to a list of the positional
869 parameters no matter what IFS is set to. */
870 + /* XXX - what to do when in a context where word splitting is not
871 + performed? Even when IFS is not the default, posix seems to imply
872 + that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2
873 + here. */
874 temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted);
876 tflag |= W_DOLLARAT;
877 @@ -8029,7 +8047,9 @@
879 goto return0;
881 - else if (var = find_variable_last_nameref (temp1))
882 + else if (var && (invisible_p (var) || var_isset (var) == 0))
883 + temp = (char *)NULL;
884 + else if ((var = find_variable_last_nameref (temp1)) && var_isset (var) && invisible_p (var) == 0)
886 temp = nameref_cell (var);
887 #if defined (ARRAY_VARS)
888 @@ -8243,7 +8263,7 @@
889 else
890 t_index = sindex + 1; /* skip past both '<' and LPAREN */
892 - temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/
893 + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/
894 sindex = t_index;
896 /* If the process substitution specification is `<()', we want to
897 @@ -8816,6 +8836,7 @@
898 else
900 char *ifs_chars;
901 + char *tstring;
903 ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL;
905 @@ -8830,11 +8851,36 @@
906 regardless of what else has happened to IFS since the expansion. */
907 if (split_on_spaces)
908 list = list_string (istring, " ", 1); /* XXX quoted == 1? */
909 + /* If we have $@ (has_dollar_at != 0) and we are in a context where we
910 + don't want to split the result (W_NOSPLIT2), and we are not quoted,
911 + we have already separated the arguments with the first character of
912 + $IFS. In this case, we want to return a list with a single word
913 + with the separator possibly replaced with a space (it's what other
914 + shells seem to do).
915 + quoted_dollar_at is internal to this function and is set if we are
916 + passed an argument that is unquoted (quoted == 0) but we encounter a
917 + double-quoted $@ while expanding it. */
918 + else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2))
920 + /* Only split and rejoin if we have to */
921 + if (*ifs_chars && *ifs_chars != ' ')
923 + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
924 + tstring = string_list (list);
926 + else
927 + tstring = istring;
928 + tword = make_bare_word (tstring);
929 + if (tstring != istring)
930 + free (tstring);
931 + goto set_word_flags;
933 else if (has_dollar_at && ifs_chars)
934 list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
935 else
937 tword = make_bare_word (istring);
938 +set_word_flags:
939 if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED))
940 tword->flags |= W_QUOTED;
941 if (word->flags & W_ASSIGNMENT)
942 --- a/subst.h 2014-01-12 03:02:27.000000000 +0100
943 +++ b/subst.h 2014-10-11 10:34:38.181611093 +0200
944 @@ -82,7 +82,7 @@
945 /* Extract the <( or >( construct in STRING, and return a new string.
946 Start extracting at (SINDEX) as if we had just seen "<(".
947 Make (SINDEX) get the position just after the matching ")". */
948 -extern char *extract_process_subst __P((char *, char *, int *));
949 +extern char *extract_process_subst __P((char *, char *, int *, int));
950 #endif /* PROCESS_SUBSTITUTION */
952 /* Extract the name of the variable to bind to from the assignment string. */
953 --- a/test.c 2014-02-04 22:52:58.000000000 +0100
954 +++ b/test.c 2014-10-11 10:34:38.181611093 +0200
955 @@ -646,8 +646,8 @@
956 return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE);
958 case 'R':
959 - v = find_variable (arg);
960 - return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);
961 + v = find_variable_noref (arg);
962 + return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE);
965 /* We can't actually get here, but this shuts up gcc. */
966 @@ -723,6 +723,7 @@
967 case 'o': case 'p': case 'r': case 's': case 't':
968 case 'u': case 'v': case 'w': case 'x': case 'z':
969 case 'G': case 'L': case 'O': case 'S': case 'N':
970 + case 'R':
971 return (1);
974 --- a/trap.c 2014-02-05 16:03:21.000000000 +0100
975 +++ b/trap.c 2014-10-11 10:34:38.181611093 +0200
976 @@ -920,7 +920,8 @@
977 subst_assign_varlist = 0;
979 #if defined (JOB_CONTROL)
980 - save_pipeline (1); /* XXX only provides one save level */
981 + if (sig != DEBUG_TRAP) /* run_debug_trap does this */
982 + save_pipeline (1); /* XXX only provides one save level */
983 #endif
985 /* If we're in a function, make sure return longjmps come here, too. */
986 @@ -940,7 +941,8 @@
987 trap_exit_value = last_command_exit_value;
989 #if defined (JOB_CONTROL)
990 - restore_pipeline (1);
991 + if (sig != DEBUG_TRAP) /* run_debug_trap does this */
992 + restore_pipeline (1);
993 #endif
995 subst_assign_varlist = save_subst_varlist;
996 --- a/variables.c 2014-02-14 17:55:12.000000000 +0100
997 +++ b/variables.c 2014-10-11 10:34:38.182611113 +0200
998 @@ -83,6 +83,11 @@
1000 #define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
1002 +#define BASHFUNC_PREFIX "BASH_FUNC_"
1003 +#define BASHFUNC_PREFLEN 10 /* == strlen(BASHFUNC_PREFIX */
1004 +#define BASHFUNC_SUFFIX "%%"
1005 +#define BASHFUNC_SUFFLEN 2 /* == strlen(BASHFUNC_SUFFIX) */
1007 extern char **environ;
1009 /* Variables used here and defined in other files. */
1010 @@ -279,7 +284,7 @@
1011 static void propagate_temp_var __P((PTR_T));
1012 static void dispose_temporary_env __P((sh_free_func_t *));
1014 -static inline char *mk_env_string __P((const char *, const char *));
1015 +static inline char *mk_env_string __P((const char *, const char *, int));
1016 static char **make_env_array_from_var_list __P((SHELL_VAR **));
1017 static char **make_var_export_array __P((VAR_CONTEXT *));
1018 static char **make_func_export_array __P((void));
1019 @@ -349,24 +354,33 @@
1021 /* If exported function, define it now. Don't import functions from
1022 the environment in privileged mode. */
1023 - if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
1024 + if (privmode == 0 && read_but_dont_execute == 0 &&
1025 + STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
1026 + STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
1027 + STREQN ("() {", string, 4))
1029 - string_length = strlen (string);
1030 - temp_string = (char *)xmalloc (3 + string_length + char_index);
1031 + size_t namelen;
1032 + char *tname; /* desired imported function name */
1034 - strcpy (temp_string, name);
1035 - temp_string[char_index] = ' ';
1036 - strcpy (temp_string + char_index + 1, string);
1037 + namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN;
1039 - if (posixly_correct == 0 || legal_identifier (name))
1040 - parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
1041 + tname = name + BASHFUNC_PREFLEN; /* start of func name */
1042 + tname[namelen] = '\0'; /* now tname == func name */
1044 + string_length = strlen (string);
1045 + temp_string = (char *)xmalloc (namelen + string_length + 2);
1047 - /* Ancient backwards compatibility. Old versions of bash exported
1048 - functions like name()=() {...} */
1049 - if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
1050 - name[char_index - 2] = '\0';
1051 + memcpy (temp_string, tname, namelen);
1052 + temp_string[namelen] = ' ';
1053 + memcpy (temp_string + namelen + 1, string, string_length + 1);
1055 + /* Don't import function names that are invalid identifiers from the
1056 + environment, though we still allow them to be defined as shell
1057 + variables. */
1058 + if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname)))
1059 + parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
1061 - if (temp_var = find_function (name))
1062 + if (temp_var = find_function (tname))
1064 VSETATTR (temp_var, (att_exported|att_imported));
1065 array_needs_making = 1;
1066 @@ -379,12 +393,11 @@
1067 array_needs_making = 1;
1069 last_command_exit_value = 1;
1070 - report_error (_("error importing function definition for `%s'"), name);
1071 + report_error (_("error importing function definition for `%s'"), tname);
1074 - /* ( */
1075 - if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
1076 - name[char_index - 2] = '('; /* ) */
1077 + /* Restore original suffix */
1078 + tname[namelen] = BASHFUNC_SUFFIX[0];
1080 #if defined (ARRAY_VARS)
1081 # if ARRAY_EXPORT
1082 @@ -2197,10 +2210,7 @@
1083 /* local foo; local foo; is a no-op. */
1084 old_var = find_variable (name);
1085 if (old_var && local_p (old_var) && old_var->context == variable_context)
1087 - VUNSETATTR (old_var, att_invisible); /* XXX */
1088 - return (old_var);
1090 + return (old_var);
1092 was_tmpvar = old_var && tempvar_p (old_var);
1093 /* If we're making a local variable in a shell function, the temporary env
1094 @@ -2963,7 +2973,7 @@
1095 var->context = variable_context; /* XXX */
1097 INVALIDATE_EXPORTSTR (var);
1098 - var->exportstr = mk_env_string (name, value);
1099 + var->exportstr = mk_env_string (name, value, 0);
1101 array_needs_making = 1;
1103 @@ -3861,21 +3871,42 @@
1104 /* **************************************************************** */
1106 static inline char *
1107 -mk_env_string (name, value)
1108 +mk_env_string (name, value, isfunc)
1109 const char *name, *value;
1110 + int isfunc;
1112 - int name_len, value_len;
1113 - char *p;
1114 + size_t name_len, value_len;
1115 + char *p, *q;
1117 name_len = strlen (name);
1118 value_len = STRLEN (value);
1119 - p = (char *)xmalloc (2 + name_len + value_len);
1120 - strcpy (p, name);
1121 - p[name_len] = '=';
1123 + /* If we are exporting a shell function, construct the encoded function
1124 + name. */
1125 + if (isfunc && value)
1127 + p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2);
1128 + q = p;
1129 + memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN);
1130 + q += BASHFUNC_PREFLEN;
1131 + memcpy (q, name, name_len);
1132 + q += name_len;
1133 + memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN);
1134 + q += BASHFUNC_SUFFLEN;
1136 + else
1138 + p = (char *)xmalloc (2 + name_len + value_len);
1139 + memcpy (p, name, name_len);
1140 + q = p + name_len;
1143 + q[0] = '=';
1144 if (value && *value)
1145 - strcpy (p + name_len + 1, value);
1146 + memcpy (q + 1, value, value_len + 1);
1147 else
1148 - p[name_len + 1] = '\0';
1149 + q[1] = '\0';
1151 return (p);
1154 @@ -3961,7 +3992,7 @@
1155 /* Gee, I'd like to get away with not using savestring() if we're
1156 using the cached exportstr... */
1157 list[list_index] = USE_EXPORTSTR ? savestring (value)
1158 - : mk_env_string (var->name, value);
1159 + : mk_env_string (var->name, value, function_p (var));
1161 if (USE_EXPORTSTR == 0)
1162 SAVE_EXPORTSTR (var, list[list_index]);
1163 --- a/y.tab.c 2014-02-11 16:57:47.000000000 +0100
1164 +++ b/y.tab.c 2014-10-11 10:37:09.628510082 +0200
1165 @@ -168,7 +168,7 @@
1168 /* Copy the first part of user declarations. */
1169 -#line 21 "/usr/homes/chet/src/bash/src/parse.y"
1170 +#line 21 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1172 #include "config.h"
1174 @@ -319,6 +319,9 @@
1176 static int reserved_word_acceptable __P((int));
1177 static int yylex __P((void));
1179 +static void push_heredoc __P((REDIRECT *));
1180 +static char *mk_alexpansion __P((char *));
1181 static int alias_expand_token __P((char *));
1182 static int time_command_acceptable __P((void));
1183 static int special_case_tokens __P((char *));
1184 @@ -416,7 +419,9 @@
1186 /* Variables to manage the task of reading here documents, because we need to
1187 defer the reading until after a complete command has been collected. */
1188 -static REDIRECT *redir_stack[10];
1189 +#define HEREDOC_MAX 16
1191 +static REDIRECT *redir_stack[HEREDOC_MAX];
1192 int need_here_doc;
1194 /* Where shell input comes from. History expansion is performed on each
1195 @@ -458,7 +463,7 @@
1196 or `for WORD' begins. This is a nested command maximum, since the array
1197 index is decremented after a case, select, or for command is parsed. */
1198 #define MAX_CASE_NEST 128
1199 -static int word_lineno[MAX_CASE_NEST];
1200 +static int word_lineno[MAX_CASE_NEST+1];
1201 static int word_top = -1;
1203 /* If non-zero, it is the token that we want read_token to return
1204 @@ -492,7 +497,7 @@
1206 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1207 typedef union YYSTYPE
1208 -#line 324 "/usr/homes/chet/src/bash/src/parse.y"
1209 +#line 329 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1211 WORD_DESC *word; /* the word that we read. */
1212 int number; /* the number that we read. */
1213 @@ -503,7 +508,7 @@
1214 PATTERN_LIST *pattern;
1216 /* Line 193 of yacc.c. */
1217 -#line 507 "y.tab.c"
1218 +#line 512 "y.tab.c"
1219 YYSTYPE;
1220 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1221 # define YYSTYPE_IS_DECLARED 1
1222 @@ -516,7 +521,7 @@
1225 /* Line 216 of yacc.c. */
1226 -#line 520 "y.tab.c"
1227 +#line 525 "y.tab.c"
1229 #ifdef short
1230 # undef short
1231 @@ -886,23 +891,23 @@
1232 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1233 static const yytype_uint16 yyrline[] =
1235 - 0, 377, 377, 388, 397, 412, 422, 424, 428, 434,
1236 - 440, 446, 452, 458, 464, 470, 476, 482, 488, 494,
1237 - 500, 506, 512, 518, 525, 532, 539, 546, 553, 560,
1238 - 566, 572, 578, 584, 590, 596, 602, 608, 614, 620,
1239 - 626, 632, 638, 644, 650, 656, 662, 668, 674, 680,
1240 - 686, 692, 700, 702, 704, 708, 712, 723, 725, 729,
1241 - 731, 733, 749, 751, 755, 757, 759, 761, 763, 765,
1242 - 767, 769, 771, 773, 775, 779, 784, 789, 794, 799,
1243 - 804, 809, 814, 821, 826, 831, 836, 843, 848, 853,
1244 - 858, 863, 868, 875, 880, 885, 892, 895, 898, 902,
1245 - 904, 935, 942, 947, 964, 969, 986, 993, 995, 997,
1246 - 1002, 1006, 1010, 1014, 1016, 1018, 1022, 1023, 1027, 1029,
1247 - 1031, 1033, 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053,
1248 - 1062, 1070, 1071, 1077, 1078, 1085, 1089, 1091, 1093, 1100,
1249 - 1102, 1104, 1108, 1109, 1112, 1114, 1116, 1120, 1121, 1130,
1250 - 1143, 1159, 1174, 1176, 1178, 1185, 1188, 1192, 1194, 1200,
1251 - 1206, 1223, 1243, 1245, 1268, 1272, 1274, 1276
1252 + 0, 382, 382, 393, 402, 417, 427, 429, 433, 439,
1253 + 445, 451, 457, 463, 469, 475, 481, 487, 493, 499,
1254 + 505, 511, 517, 523, 530, 537, 544, 551, 558, 565,
1255 + 571, 577, 583, 589, 595, 601, 607, 613, 619, 625,
1256 + 631, 637, 643, 649, 655, 661, 667, 673, 679, 685,
1257 + 691, 697, 705, 707, 709, 713, 717, 728, 730, 734,
1258 + 736, 738, 754, 756, 760, 762, 764, 766, 768, 770,
1259 + 772, 774, 776, 778, 780, 784, 789, 794, 799, 804,
1260 + 809, 814, 819, 826, 831, 836, 841, 848, 853, 858,
1261 + 863, 868, 873, 880, 885, 890, 897, 900, 903, 907,
1262 + 909, 940, 947, 952, 969, 974, 991, 998, 1000, 1002,
1263 + 1007, 1011, 1015, 1019, 1021, 1023, 1027, 1028, 1032, 1034,
1264 + 1036, 1038, 1042, 1044, 1046, 1048, 1050, 1052, 1056, 1058,
1265 + 1067, 1075, 1076, 1082, 1083, 1090, 1094, 1096, 1098, 1105,
1266 + 1107, 1109, 1113, 1114, 1117, 1119, 1121, 1125, 1126, 1135,
1267 + 1148, 1164, 1179, 1181, 1183, 1190, 1193, 1197, 1199, 1205,
1268 + 1211, 1228, 1248, 1250, 1273, 1277, 1279, 1281
1270 #endif
1272 @@ -2093,7 +2098,7 @@
1273 switch (yyn)
1275 case 2:
1276 -#line 378 "/usr/homes/chet/src/bash/src/parse.y"
1277 +#line 383 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1279 /* Case of regular command. Discard the error
1280 safety net,and return the command just parsed. */
1281 @@ -2107,7 +2112,7 @@
1282 break;
1284 case 3:
1285 -#line 389 "/usr/homes/chet/src/bash/src/parse.y"
1286 +#line 394 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1288 /* Case of regular command, but not a very
1289 interesting one. Return a NULL command. */
1290 @@ -2119,7 +2124,7 @@
1291 break;
1293 case 4:
1294 -#line 398 "/usr/homes/chet/src/bash/src/parse.y"
1295 +#line 403 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1297 /* Error during parsing. Return NULL command. */
1298 global_command = (COMMAND *)NULL;
1299 @@ -2137,7 +2142,7 @@
1300 break;
1302 case 5:
1303 -#line 413 "/usr/homes/chet/src/bash/src/parse.y"
1304 +#line 418 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1306 /* Case of EOF seen by itself. Do ignoreeof or
1307 not. */
1308 @@ -2148,17 +2153,17 @@
1309 break;
1311 case 6:
1312 -#line 423 "/usr/homes/chet/src/bash/src/parse.y"
1313 +#line 428 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1314 { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
1315 break;
1317 case 7:
1318 -#line 425 "/usr/homes/chet/src/bash/src/parse.y"
1319 +#line 430 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1320 { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
1321 break;
1323 case 8:
1324 -#line 429 "/usr/homes/chet/src/bash/src/parse.y"
1325 +#line 434 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1327 source.dest = 1;
1328 redir.filename = (yyvsp[(2) - (2)].word);
1329 @@ -2167,7 +2172,7 @@
1330 break;
1332 case 9:
1333 -#line 435 "/usr/homes/chet/src/bash/src/parse.y"
1334 +#line 440 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1336 source.dest = 0;
1337 redir.filename = (yyvsp[(2) - (2)].word);
1338 @@ -2176,7 +2181,7 @@
1339 break;
1341 case 10:
1342 -#line 441 "/usr/homes/chet/src/bash/src/parse.y"
1343 +#line 446 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1345 source.dest = (yyvsp[(1) - (3)].number);
1346 redir.filename = (yyvsp[(3) - (3)].word);
1347 @@ -2185,7 +2190,7 @@
1348 break;
1350 case 11:
1351 -#line 447 "/usr/homes/chet/src/bash/src/parse.y"
1352 +#line 452 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1354 source.dest = (yyvsp[(1) - (3)].number);
1355 redir.filename = (yyvsp[(3) - (3)].word);
1356 @@ -2194,7 +2199,7 @@
1357 break;
1359 case 12:
1360 -#line 453 "/usr/homes/chet/src/bash/src/parse.y"
1361 +#line 458 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1363 source.filename = (yyvsp[(1) - (3)].word);
1364 redir.filename = (yyvsp[(3) - (3)].word);
1365 @@ -2203,7 +2208,7 @@
1366 break;
1368 case 13:
1369 -#line 459 "/usr/homes/chet/src/bash/src/parse.y"
1370 +#line 464 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1372 source.filename = (yyvsp[(1) - (3)].word);
1373 redir.filename = (yyvsp[(3) - (3)].word);
1374 @@ -2212,7 +2217,7 @@
1375 break;
1377 case 14:
1378 -#line 465 "/usr/homes/chet/src/bash/src/parse.y"
1379 +#line 470 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1381 source.dest = 1;
1382 redir.filename = (yyvsp[(2) - (2)].word);
1383 @@ -2221,7 +2226,7 @@
1384 break;
1386 case 15:
1387 -#line 471 "/usr/homes/chet/src/bash/src/parse.y"
1388 +#line 476 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1390 source.dest = (yyvsp[(1) - (3)].number);
1391 redir.filename = (yyvsp[(3) - (3)].word);
1392 @@ -2230,7 +2235,7 @@
1393 break;
1395 case 16:
1396 -#line 477 "/usr/homes/chet/src/bash/src/parse.y"
1397 +#line 482 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1399 source.filename = (yyvsp[(1) - (3)].word);
1400 redir.filename = (yyvsp[(3) - (3)].word);
1401 @@ -2239,7 +2244,7 @@
1402 break;
1404 case 17:
1405 -#line 483 "/usr/homes/chet/src/bash/src/parse.y"
1406 +#line 488 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1408 source.dest = 1;
1409 redir.filename = (yyvsp[(2) - (2)].word);
1410 @@ -2248,7 +2253,7 @@
1411 break;
1413 case 18:
1414 -#line 489 "/usr/homes/chet/src/bash/src/parse.y"
1415 +#line 494 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1417 source.dest = (yyvsp[(1) - (3)].number);
1418 redir.filename = (yyvsp[(3) - (3)].word);
1419 @@ -2257,7 +2262,7 @@
1420 break;
1422 case 19:
1423 -#line 495 "/usr/homes/chet/src/bash/src/parse.y"
1424 +#line 500 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1426 source.filename = (yyvsp[(1) - (3)].word);
1427 redir.filename = (yyvsp[(3) - (3)].word);
1428 @@ -2266,7 +2271,7 @@
1429 break;
1431 case 20:
1432 -#line 501 "/usr/homes/chet/src/bash/src/parse.y"
1433 +#line 506 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1435 source.dest = 0;
1436 redir.filename = (yyvsp[(2) - (2)].word);
1437 @@ -2275,7 +2280,7 @@
1438 break;
1440 case 21:
1441 -#line 507 "/usr/homes/chet/src/bash/src/parse.y"
1442 +#line 512 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1444 source.dest = (yyvsp[(1) - (3)].number);
1445 redir.filename = (yyvsp[(3) - (3)].word);
1446 @@ -2284,7 +2289,7 @@
1447 break;
1449 case 22:
1450 -#line 513 "/usr/homes/chet/src/bash/src/parse.y"
1451 +#line 518 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1453 source.filename = (yyvsp[(1) - (3)].word);
1454 redir.filename = (yyvsp[(3) - (3)].word);
1455 @@ -2293,67 +2298,67 @@
1456 break;
1458 case 23:
1459 -#line 519 "/usr/homes/chet/src/bash/src/parse.y"
1460 +#line 524 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1462 source.dest = 0;
1463 redir.filename = (yyvsp[(2) - (2)].word);
1464 (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
1465 - redir_stack[need_here_doc++] = (yyval.redirect);
1466 + push_heredoc ((yyval.redirect));
1468 break;
1470 case 24:
1471 -#line 526 "/usr/homes/chet/src/bash/src/parse.y"
1472 +#line 531 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1474 source.dest = (yyvsp[(1) - (3)].number);
1475 redir.filename = (yyvsp[(3) - (3)].word);
1476 (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
1477 - redir_stack[need_here_doc++] = (yyval.redirect);
1478 + push_heredoc ((yyval.redirect));
1480 break;
1482 case 25:
1483 -#line 533 "/usr/homes/chet/src/bash/src/parse.y"
1484 +#line 538 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1486 source.filename = (yyvsp[(1) - (3)].word);
1487 redir.filename = (yyvsp[(3) - (3)].word);
1488 (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
1489 - redir_stack[need_here_doc++] = (yyval.redirect);
1490 + push_heredoc ((yyval.redirect));
1492 break;
1494 case 26:
1495 -#line 540 "/usr/homes/chet/src/bash/src/parse.y"
1496 +#line 545 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1498 source.dest = 0;
1499 redir.filename = (yyvsp[(2) - (2)].word);
1500 (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
1501 - redir_stack[need_here_doc++] = (yyval.redirect);
1502 + push_heredoc ((yyval.redirect));
1504 break;
1506 case 27:
1507 -#line 547 "/usr/homes/chet/src/bash/src/parse.y"
1508 +#line 552 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1510 source.dest = (yyvsp[(1) - (3)].number);
1511 redir.filename = (yyvsp[(3) - (3)].word);
1512 (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
1513 - redir_stack[need_here_doc++] = (yyval.redirect);
1514 + push_heredoc ((yyval.redirect));
1516 break;
1518 case 28:
1519 -#line 554 "/usr/homes/chet/src/bash/src/parse.y"
1520 +#line 559 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1522 source.filename = (yyvsp[(1) - (3)].word);
1523 redir.filename = (yyvsp[(3) - (3)].word);
1524 (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
1525 - redir_stack[need_here_doc++] = (yyval.redirect);
1526 + push_heredoc ((yyval.redirect));
1528 break;
1530 case 29:
1531 -#line 561 "/usr/homes/chet/src/bash/src/parse.y"
1532 +#line 566 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1534 source.dest = 0;
1535 redir.filename = (yyvsp[(2) - (2)].word);
1536 @@ -2362,7 +2367,7 @@
1537 break;
1539 case 30:
1540 -#line 567 "/usr/homes/chet/src/bash/src/parse.y"
1541 +#line 572 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1543 source.dest = (yyvsp[(1) - (3)].number);
1544 redir.filename = (yyvsp[(3) - (3)].word);
1545 @@ -2371,7 +2376,7 @@
1546 break;
1548 case 31:
1549 -#line 573 "/usr/homes/chet/src/bash/src/parse.y"
1550 +#line 578 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1552 source.filename = (yyvsp[(1) - (3)].word);
1553 redir.filename = (yyvsp[(3) - (3)].word);
1554 @@ -2380,7 +2385,7 @@
1555 break;
1557 case 32:
1558 -#line 579 "/usr/homes/chet/src/bash/src/parse.y"
1559 +#line 584 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1561 source.dest = 0;
1562 redir.dest = (yyvsp[(2) - (2)].number);
1563 @@ -2389,7 +2394,7 @@
1564 break;
1566 case 33:
1567 -#line 585 "/usr/homes/chet/src/bash/src/parse.y"
1568 +#line 590 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1570 source.dest = (yyvsp[(1) - (3)].number);
1571 redir.dest = (yyvsp[(3) - (3)].number);
1572 @@ -2398,7 +2403,7 @@
1573 break;
1575 case 34:
1576 -#line 591 "/usr/homes/chet/src/bash/src/parse.y"
1577 +#line 596 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1579 source.filename = (yyvsp[(1) - (3)].word);
1580 redir.dest = (yyvsp[(3) - (3)].number);
1581 @@ -2407,7 +2412,7 @@
1582 break;
1584 case 35:
1585 -#line 597 "/usr/homes/chet/src/bash/src/parse.y"
1586 +#line 602 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1588 source.dest = 1;
1589 redir.dest = (yyvsp[(2) - (2)].number);
1590 @@ -2416,7 +2421,7 @@
1591 break;
1593 case 36:
1594 -#line 603 "/usr/homes/chet/src/bash/src/parse.y"
1595 +#line 608 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1597 source.dest = (yyvsp[(1) - (3)].number);
1598 redir.dest = (yyvsp[(3) - (3)].number);
1599 @@ -2425,7 +2430,7 @@
1600 break;
1602 case 37:
1603 -#line 609 "/usr/homes/chet/src/bash/src/parse.y"
1604 +#line 614 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1606 source.filename = (yyvsp[(1) - (3)].word);
1607 redir.dest = (yyvsp[(3) - (3)].number);
1608 @@ -2434,7 +2439,7 @@
1609 break;
1611 case 38:
1612 -#line 615 "/usr/homes/chet/src/bash/src/parse.y"
1613 +#line 620 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1615 source.dest = 0;
1616 redir.filename = (yyvsp[(2) - (2)].word);
1617 @@ -2443,7 +2448,7 @@
1618 break;
1620 case 39:
1621 -#line 621 "/usr/homes/chet/src/bash/src/parse.y"
1622 +#line 626 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1624 source.dest = (yyvsp[(1) - (3)].number);
1625 redir.filename = (yyvsp[(3) - (3)].word);
1626 @@ -2452,7 +2457,7 @@
1627 break;
1629 case 40:
1630 -#line 627 "/usr/homes/chet/src/bash/src/parse.y"
1631 +#line 632 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1633 source.filename = (yyvsp[(1) - (3)].word);
1634 redir.filename = (yyvsp[(3) - (3)].word);
1635 @@ -2461,7 +2466,7 @@
1636 break;
1638 case 41:
1639 -#line 633 "/usr/homes/chet/src/bash/src/parse.y"
1640 +#line 638 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1642 source.dest = 1;
1643 redir.filename = (yyvsp[(2) - (2)].word);
1644 @@ -2470,7 +2475,7 @@
1645 break;
1647 case 42:
1648 -#line 639 "/usr/homes/chet/src/bash/src/parse.y"
1649 +#line 644 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1651 source.dest = (yyvsp[(1) - (3)].number);
1652 redir.filename = (yyvsp[(3) - (3)].word);
1653 @@ -2479,7 +2484,7 @@
1654 break;
1656 case 43:
1657 -#line 645 "/usr/homes/chet/src/bash/src/parse.y"
1658 +#line 650 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1660 source.filename = (yyvsp[(1) - (3)].word);
1661 redir.filename = (yyvsp[(3) - (3)].word);
1662 @@ -2488,7 +2493,7 @@
1663 break;
1665 case 44:
1666 -#line 651 "/usr/homes/chet/src/bash/src/parse.y"
1667 +#line 656 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1669 source.dest = 1;
1670 redir.dest = 0;
1671 @@ -2497,7 +2502,7 @@
1672 break;
1674 case 45:
1675 -#line 657 "/usr/homes/chet/src/bash/src/parse.y"
1676 +#line 662 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1678 source.dest = (yyvsp[(1) - (3)].number);
1679 redir.dest = 0;
1680 @@ -2506,7 +2511,7 @@
1681 break;
1683 case 46:
1684 -#line 663 "/usr/homes/chet/src/bash/src/parse.y"
1685 +#line 668 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1687 source.filename = (yyvsp[(1) - (3)].word);
1688 redir.dest = 0;
1689 @@ -2515,7 +2520,7 @@
1690 break;
1692 case 47:
1693 -#line 669 "/usr/homes/chet/src/bash/src/parse.y"
1694 +#line 674 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1696 source.dest = 0;
1697 redir.dest = 0;
1698 @@ -2524,7 +2529,7 @@
1699 break;
1701 case 48:
1702 -#line 675 "/usr/homes/chet/src/bash/src/parse.y"
1703 +#line 680 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1705 source.dest = (yyvsp[(1) - (3)].number);
1706 redir.dest = 0;
1707 @@ -2533,7 +2538,7 @@
1708 break;
1710 case 49:
1711 -#line 681 "/usr/homes/chet/src/bash/src/parse.y"
1712 +#line 686 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1714 source.filename = (yyvsp[(1) - (3)].word);
1715 redir.dest = 0;
1716 @@ -2542,7 +2547,7 @@
1717 break;
1719 case 50:
1720 -#line 687 "/usr/homes/chet/src/bash/src/parse.y"
1721 +#line 692 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1723 source.dest = 1;
1724 redir.filename = (yyvsp[(2) - (2)].word);
1725 @@ -2551,7 +2556,7 @@
1726 break;
1728 case 51:
1729 -#line 693 "/usr/homes/chet/src/bash/src/parse.y"
1730 +#line 698 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1732 source.dest = 1;
1733 redir.filename = (yyvsp[(2) - (2)].word);
1734 @@ -2560,29 +2565,29 @@
1735 break;
1737 case 52:
1738 -#line 701 "/usr/homes/chet/src/bash/src/parse.y"
1739 +#line 706 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1740 { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
1741 break;
1743 case 53:
1744 -#line 703 "/usr/homes/chet/src/bash/src/parse.y"
1745 +#line 708 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1746 { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
1747 break;
1749 case 54:
1750 -#line 705 "/usr/homes/chet/src/bash/src/parse.y"
1751 +#line 710 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1752 { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
1753 break;
1755 case 55:
1756 -#line 709 "/usr/homes/chet/src/bash/src/parse.y"
1757 +#line 714 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1759 (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
1761 break;
1763 case 56:
1764 -#line 713 "/usr/homes/chet/src/bash/src/parse.y"
1765 +#line 718 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1767 register REDIRECT *t;
1769 @@ -2594,27 +2599,27 @@
1770 break;
1772 case 57:
1773 -#line 724 "/usr/homes/chet/src/bash/src/parse.y"
1774 +#line 729 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1775 { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
1776 break;
1778 case 58:
1779 -#line 726 "/usr/homes/chet/src/bash/src/parse.y"
1780 +#line 731 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1781 { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
1782 break;
1784 case 59:
1785 -#line 730 "/usr/homes/chet/src/bash/src/parse.y"
1786 +#line 735 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1787 { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
1788 break;
1790 case 60:
1791 -#line 732 "/usr/homes/chet/src/bash/src/parse.y"
1792 +#line 737 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1793 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1794 break;
1796 case 61:
1797 -#line 734 "/usr/homes/chet/src/bash/src/parse.y"
1798 +#line 739 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1800 COMMAND *tc;
1802 @@ -2633,72 +2638,72 @@
1803 break;
1805 case 62:
1806 -#line 750 "/usr/homes/chet/src/bash/src/parse.y"
1807 +#line 755 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1808 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1809 break;
1811 case 63:
1812 -#line 752 "/usr/homes/chet/src/bash/src/parse.y"
1813 +#line 757 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1814 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1815 break;
1817 case 64:
1818 -#line 756 "/usr/homes/chet/src/bash/src/parse.y"
1819 +#line 761 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1820 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1821 break;
1823 case 65:
1824 -#line 758 "/usr/homes/chet/src/bash/src/parse.y"
1825 +#line 763 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1826 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1827 break;
1829 case 66:
1830 -#line 760 "/usr/homes/chet/src/bash/src/parse.y"
1831 +#line 765 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1832 { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
1833 break;
1835 case 67:
1836 -#line 762 "/usr/homes/chet/src/bash/src/parse.y"
1837 +#line 767 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1838 { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
1839 break;
1841 case 68:
1842 -#line 764 "/usr/homes/chet/src/bash/src/parse.y"
1843 +#line 769 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1844 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1845 break;
1847 case 69:
1848 -#line 766 "/usr/homes/chet/src/bash/src/parse.y"
1849 +#line 771 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1850 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1851 break;
1853 case 70:
1854 -#line 768 "/usr/homes/chet/src/bash/src/parse.y"
1855 +#line 773 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1856 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1857 break;
1859 case 71:
1860 -#line 770 "/usr/homes/chet/src/bash/src/parse.y"
1861 +#line 775 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1862 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1863 break;
1865 case 72:
1866 -#line 772 "/usr/homes/chet/src/bash/src/parse.y"
1867 +#line 777 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1868 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1869 break;
1871 case 73:
1872 -#line 774 "/usr/homes/chet/src/bash/src/parse.y"
1873 +#line 779 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1874 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1875 break;
1877 case 74:
1878 -#line 776 "/usr/homes/chet/src/bash/src/parse.y"
1879 +#line 781 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1880 { (yyval.command) = (yyvsp[(1) - (1)].command); }
1881 break;
1883 case 75:
1884 -#line 780 "/usr/homes/chet/src/bash/src/parse.y"
1885 +#line 785 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1887 (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
1888 if (word_top > 0) word_top--;
1889 @@ -2706,7 +2711,7 @@
1890 break;
1892 case 76:
1893 -#line 785 "/usr/homes/chet/src/bash/src/parse.y"
1894 +#line 790 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1896 (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
1897 if (word_top > 0) word_top--;
1898 @@ -2714,7 +2719,7 @@
1899 break;
1901 case 77:
1902 -#line 790 "/usr/homes/chet/src/bash/src/parse.y"
1903 +#line 795 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1905 (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
1906 if (word_top > 0) word_top--;
1907 @@ -2722,7 +2727,7 @@
1908 break;
1910 case 78:
1911 -#line 795 "/usr/homes/chet/src/bash/src/parse.y"
1912 +#line 800 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1914 (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
1915 if (word_top > 0) word_top--;
1916 @@ -2730,7 +2735,7 @@
1917 break;
1919 case 79:
1920 -#line 800 "/usr/homes/chet/src/bash/src/parse.y"
1921 +#line 805 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1923 (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
1924 if (word_top > 0) word_top--;
1925 @@ -2738,7 +2743,7 @@
1926 break;
1928 case 80:
1929 -#line 805 "/usr/homes/chet/src/bash/src/parse.y"
1930 +#line 810 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1932 (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
1933 if (word_top > 0) word_top--;
1934 @@ -2746,7 +2751,7 @@
1935 break;
1937 case 81:
1938 -#line 810 "/usr/homes/chet/src/bash/src/parse.y"
1939 +#line 815 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1941 (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
1942 if (word_top > 0) word_top--;
1943 @@ -2754,7 +2759,7 @@
1944 break;
1946 case 82:
1947 -#line 815 "/usr/homes/chet/src/bash/src/parse.y"
1948 +#line 820 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1950 (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
1951 if (word_top > 0) word_top--;
1952 @@ -2762,7 +2767,7 @@
1953 break;
1955 case 83:
1956 -#line 822 "/usr/homes/chet/src/bash/src/parse.y"
1957 +#line 827 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1959 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
1960 if (word_top > 0) word_top--;
1961 @@ -2770,7 +2775,7 @@
1962 break;
1964 case 84:
1965 -#line 827 "/usr/homes/chet/src/bash/src/parse.y"
1966 +#line 832 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1968 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
1969 if (word_top > 0) word_top--;
1970 @@ -2778,7 +2783,7 @@
1971 break;
1973 case 85:
1974 -#line 832 "/usr/homes/chet/src/bash/src/parse.y"
1975 +#line 837 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1977 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
1978 if (word_top > 0) word_top--;
1979 @@ -2786,7 +2791,7 @@
1980 break;
1982 case 86:
1983 -#line 837 "/usr/homes/chet/src/bash/src/parse.y"
1984 +#line 842 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1986 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
1987 if (word_top > 0) word_top--;
1988 @@ -2794,7 +2799,7 @@
1989 break;
1991 case 87:
1992 -#line 844 "/usr/homes/chet/src/bash/src/parse.y"
1993 +#line 849 "/usr/src/local/bash/bash-4.3-patched/parse.y"
1995 (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
1996 if (word_top > 0) word_top--;
1997 @@ -2802,7 +2807,7 @@
1998 break;
2000 case 88:
2001 -#line 849 "/usr/homes/chet/src/bash/src/parse.y"
2002 +#line 854 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2004 (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
2005 if (word_top > 0) word_top--;
2006 @@ -2810,7 +2815,7 @@
2007 break;
2009 case 89:
2010 -#line 854 "/usr/homes/chet/src/bash/src/parse.y"
2011 +#line 859 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2013 (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
2014 if (word_top > 0) word_top--;
2015 @@ -2818,7 +2823,7 @@
2016 break;
2018 case 90:
2019 -#line 859 "/usr/homes/chet/src/bash/src/parse.y"
2020 +#line 864 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2022 (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
2023 if (word_top > 0) word_top--;
2024 @@ -2826,7 +2831,7 @@
2025 break;
2027 case 91:
2028 -#line 864 "/usr/homes/chet/src/bash/src/parse.y"
2029 +#line 869 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2031 (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
2032 if (word_top > 0) word_top--;
2033 @@ -2834,7 +2839,7 @@
2034 break;
2036 case 92:
2037 -#line 869 "/usr/homes/chet/src/bash/src/parse.y"
2038 +#line 874 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2040 (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
2041 if (word_top > 0) word_top--;
2042 @@ -2842,7 +2847,7 @@
2043 break;
2045 case 93:
2046 -#line 876 "/usr/homes/chet/src/bash/src/parse.y"
2047 +#line 881 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2049 (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
2050 if (word_top > 0) word_top--;
2051 @@ -2850,7 +2855,7 @@
2052 break;
2054 case 94:
2055 -#line 881 "/usr/homes/chet/src/bash/src/parse.y"
2056 +#line 886 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2058 (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
2059 if (word_top > 0) word_top--;
2060 @@ -2858,7 +2863,7 @@
2061 break;
2063 case 95:
2064 -#line 886 "/usr/homes/chet/src/bash/src/parse.y"
2065 +#line 891 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2067 (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
2068 if (word_top > 0) word_top--;
2069 @@ -2866,27 +2871,27 @@
2070 break;
2072 case 96:
2073 -#line 893 "/usr/homes/chet/src/bash/src/parse.y"
2074 +#line 898 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2075 { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
2076 break;
2078 case 97:
2079 -#line 896 "/usr/homes/chet/src/bash/src/parse.y"
2080 +#line 901 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2081 { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
2082 break;
2084 case 98:
2085 -#line 899 "/usr/homes/chet/src/bash/src/parse.y"
2086 +#line 904 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2087 { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
2088 break;
2090 case 99:
2091 -#line 903 "/usr/homes/chet/src/bash/src/parse.y"
2092 +#line 908 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2093 { (yyval.command) = (yyvsp[(1) - (1)].command); }
2094 break;
2096 case 100:
2097 -#line 905 "/usr/homes/chet/src/bash/src/parse.y"
2098 +#line 910 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2100 COMMAND *tc;
2102 @@ -2918,7 +2923,7 @@
2103 break;
2105 case 101:
2106 -#line 936 "/usr/homes/chet/src/bash/src/parse.y"
2107 +#line 941 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2109 (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
2110 (yyval.command)->flags |= CMD_WANT_SUBSHELL;
2111 @@ -2926,7 +2931,7 @@
2112 break;
2114 case 102:
2115 -#line 943 "/usr/homes/chet/src/bash/src/parse.y"
2116 +#line 948 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2118 (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
2119 (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
2120 @@ -2934,7 +2939,7 @@
2121 break;
2123 case 103:
2124 -#line 948 "/usr/homes/chet/src/bash/src/parse.y"
2125 +#line 953 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2127 COMMAND *tc;
2129 @@ -2954,7 +2959,7 @@
2130 break;
2132 case 104:
2133 -#line 965 "/usr/homes/chet/src/bash/src/parse.y"
2134 +#line 970 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2136 (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
2137 (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
2138 @@ -2962,7 +2967,7 @@
2139 break;
2141 case 105:
2142 -#line 970 "/usr/homes/chet/src/bash/src/parse.y"
2143 +#line 975 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2145 COMMAND *tc;
2147 @@ -2982,7 +2987,7 @@
2148 break;
2150 case 106:
2151 -#line 987 "/usr/homes/chet/src/bash/src/parse.y"
2152 +#line 992 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2154 (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
2155 (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
2156 @@ -2990,117 +2995,117 @@
2157 break;
2159 case 107:
2160 -#line 994 "/usr/homes/chet/src/bash/src/parse.y"
2161 +#line 999 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2162 { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
2163 break;
2165 case 108:
2166 -#line 996 "/usr/homes/chet/src/bash/src/parse.y"
2167 +#line 1001 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2168 { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
2169 break;
2171 case 109:
2172 -#line 998 "/usr/homes/chet/src/bash/src/parse.y"
2173 +#line 1003 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2174 { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
2175 break;
2177 case 110:
2178 -#line 1003 "/usr/homes/chet/src/bash/src/parse.y"
2179 +#line 1008 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2180 { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
2181 break;
2183 case 111:
2184 -#line 1007 "/usr/homes/chet/src/bash/src/parse.y"
2185 +#line 1012 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2186 { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
2187 break;
2189 case 112:
2190 -#line 1011 "/usr/homes/chet/src/bash/src/parse.y"
2191 +#line 1016 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2192 { (yyval.command) = (yyvsp[(2) - (3)].command); }
2193 break;
2195 case 113:
2196 -#line 1015 "/usr/homes/chet/src/bash/src/parse.y"
2197 +#line 1020 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2198 { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
2199 break;
2201 case 114:
2202 -#line 1017 "/usr/homes/chet/src/bash/src/parse.y"
2203 +#line 1022 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2204 { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
2205 break;
2207 case 115:
2208 -#line 1019 "/usr/homes/chet/src/bash/src/parse.y"
2209 +#line 1024 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2210 { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
2211 break;
2213 case 117:
2214 -#line 1024 "/usr/homes/chet/src/bash/src/parse.y"
2215 +#line 1029 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2216 { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
2217 break;
2219 case 118:
2220 -#line 1028 "/usr/homes/chet/src/bash/src/parse.y"
2221 +#line 1033 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2222 { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
2223 break;
2225 case 119:
2226 -#line 1030 "/usr/homes/chet/src/bash/src/parse.y"
2227 +#line 1035 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2228 { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
2229 break;
2231 case 120:
2232 -#line 1032 "/usr/homes/chet/src/bash/src/parse.y"
2233 +#line 1037 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2234 { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
2235 break;
2237 case 121:
2238 -#line 1034 "/usr/homes/chet/src/bash/src/parse.y"
2239 +#line 1039 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2240 { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
2241 break;
2243 case 122:
2244 -#line 1038 "/usr/homes/chet/src/bash/src/parse.y"
2245 +#line 1043 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2246 { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
2247 break;
2249 case 123:
2250 -#line 1040 "/usr/homes/chet/src/bash/src/parse.y"
2251 +#line 1045 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2252 { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
2253 break;
2255 case 124:
2256 -#line 1042 "/usr/homes/chet/src/bash/src/parse.y"
2257 +#line 1047 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2258 { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
2259 break;
2261 case 125:
2262 -#line 1044 "/usr/homes/chet/src/bash/src/parse.y"
2263 +#line 1049 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2264 { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
2265 break;
2267 case 126:
2268 -#line 1046 "/usr/homes/chet/src/bash/src/parse.y"
2269 +#line 1051 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2270 { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
2271 break;
2273 case 127:
2274 -#line 1048 "/usr/homes/chet/src/bash/src/parse.y"
2275 +#line 1053 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2276 { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
2277 break;
2279 case 128:
2280 -#line 1052 "/usr/homes/chet/src/bash/src/parse.y"
2281 +#line 1057 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2282 { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
2283 break;
2285 case 129:
2286 -#line 1054 "/usr/homes/chet/src/bash/src/parse.y"
2287 +#line 1059 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2288 { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
2289 break;
2291 case 130:
2292 -#line 1063 "/usr/homes/chet/src/bash/src/parse.y"
2293 +#line 1068 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2295 (yyval.command) = (yyvsp[(2) - (2)].command);
2296 if (need_here_doc)
2297 @@ -3109,14 +3114,14 @@
2298 break;
2300 case 132:
2301 -#line 1072 "/usr/homes/chet/src/bash/src/parse.y"
2302 +#line 1077 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2304 (yyval.command) = (yyvsp[(2) - (2)].command);
2306 break;
2308 case 134:
2309 -#line 1079 "/usr/homes/chet/src/bash/src/parse.y"
2310 +#line 1084 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2312 if ((yyvsp[(1) - (3)].command)->type == cm_connection)
2313 (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&');
2314 @@ -3126,17 +3131,17 @@
2315 break;
2317 case 136:
2318 -#line 1090 "/usr/homes/chet/src/bash/src/parse.y"
2319 +#line 1095 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2320 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
2321 break;
2323 case 137:
2324 -#line 1092 "/usr/homes/chet/src/bash/src/parse.y"
2325 +#line 1097 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2326 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
2327 break;
2329 case 138:
2330 -#line 1094 "/usr/homes/chet/src/bash/src/parse.y"
2331 +#line 1099 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2333 if ((yyvsp[(1) - (4)].command)->type == cm_connection)
2334 (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&');
2335 @@ -3146,37 +3151,37 @@
2336 break;
2338 case 139:
2339 -#line 1101 "/usr/homes/chet/src/bash/src/parse.y"
2340 +#line 1106 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2341 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
2342 break;
2344 case 140:
2345 -#line 1103 "/usr/homes/chet/src/bash/src/parse.y"
2346 +#line 1108 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2347 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
2348 break;
2350 case 141:
2351 -#line 1105 "/usr/homes/chet/src/bash/src/parse.y"
2352 +#line 1110 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2353 { (yyval.command) = (yyvsp[(1) - (1)].command); }
2354 break;
2356 case 144:
2357 -#line 1113 "/usr/homes/chet/src/bash/src/parse.y"
2358 +#line 1118 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2359 { (yyval.number) = '\n'; }
2360 break;
2362 case 145:
2363 -#line 1115 "/usr/homes/chet/src/bash/src/parse.y"
2364 +#line 1120 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2365 { (yyval.number) = ';'; }
2366 break;
2368 case 146:
2369 -#line 1117 "/usr/homes/chet/src/bash/src/parse.y"
2370 +#line 1122 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2371 { (yyval.number) = yacc_EOF; }
2372 break;
2374 case 149:
2375 -#line 1131 "/usr/homes/chet/src/bash/src/parse.y"
2376 +#line 1136 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2378 (yyval.command) = (yyvsp[(1) - (1)].command);
2379 if (need_here_doc)
2380 @@ -3192,7 +3197,7 @@
2381 break;
2383 case 150:
2384 -#line 1144 "/usr/homes/chet/src/bash/src/parse.y"
2385 +#line 1149 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2387 if ((yyvsp[(1) - (2)].command)->type == cm_connection)
2388 (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&');
2389 @@ -3211,7 +3216,7 @@
2390 break;
2392 case 151:
2393 -#line 1160 "/usr/homes/chet/src/bash/src/parse.y"
2394 +#line 1165 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2396 (yyval.command) = (yyvsp[(1) - (2)].command);
2397 if (need_here_doc)
2398 @@ -3227,17 +3232,17 @@
2399 break;
2401 case 152:
2402 -#line 1175 "/usr/homes/chet/src/bash/src/parse.y"
2403 +#line 1180 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2404 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
2405 break;
2407 case 153:
2408 -#line 1177 "/usr/homes/chet/src/bash/src/parse.y"
2409 +#line 1182 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2410 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
2411 break;
2413 case 154:
2414 -#line 1179 "/usr/homes/chet/src/bash/src/parse.y"
2415 +#line 1184 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2417 if ((yyvsp[(1) - (3)].command)->type == cm_connection)
2418 (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&');
2419 @@ -3247,22 +3252,22 @@
2420 break;
2422 case 155:
2423 -#line 1186 "/usr/homes/chet/src/bash/src/parse.y"
2424 +#line 1191 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2425 { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
2426 break;
2428 case 156:
2429 -#line 1189 "/usr/homes/chet/src/bash/src/parse.y"
2430 +#line 1194 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2431 { (yyval.command) = (yyvsp[(1) - (1)].command); }
2432 break;
2434 case 157:
2435 -#line 1193 "/usr/homes/chet/src/bash/src/parse.y"
2436 +#line 1198 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2437 { (yyval.command) = (yyvsp[(1) - (1)].command); }
2438 break;
2440 case 158:
2441 -#line 1195 "/usr/homes/chet/src/bash/src/parse.y"
2442 +#line 1200 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2444 if ((yyvsp[(2) - (2)].command))
2445 (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */
2446 @@ -3271,7 +3276,7 @@
2447 break;
2449 case 159:
2450 -#line 1201 "/usr/homes/chet/src/bash/src/parse.y"
2451 +#line 1206 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2453 if ((yyvsp[(2) - (2)].command))
2454 (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number);
2455 @@ -3280,7 +3285,7 @@
2456 break;
2458 case 160:
2459 -#line 1207 "/usr/homes/chet/src/bash/src/parse.y"
2460 +#line 1212 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2462 ELEMENT x;
2464 @@ -3300,7 +3305,7 @@
2465 break;
2467 case 161:
2468 -#line 1224 "/usr/homes/chet/src/bash/src/parse.y"
2469 +#line 1229 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2471 ELEMENT x;
2473 @@ -3321,12 +3326,12 @@
2474 break;
2476 case 162:
2477 -#line 1244 "/usr/homes/chet/src/bash/src/parse.y"
2478 +#line 1249 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2479 { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
2480 break;
2482 case 163:
2483 -#line 1246 "/usr/homes/chet/src/bash/src/parse.y"
2484 +#line 1251 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2486 /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
2487 COMMAND *tc;
2488 @@ -3352,28 +3357,28 @@
2489 break;
2491 case 164:
2492 -#line 1269 "/usr/homes/chet/src/bash/src/parse.y"
2493 +#line 1274 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2494 { (yyval.command) = (yyvsp[(1) - (1)].command); }
2495 break;
2497 case 165:
2498 -#line 1273 "/usr/homes/chet/src/bash/src/parse.y"
2499 +#line 1278 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2500 { (yyval.number) = CMD_TIME_PIPELINE; }
2501 break;
2503 case 166:
2504 -#line 1275 "/usr/homes/chet/src/bash/src/parse.y"
2505 +#line 1280 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2506 { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
2507 break;
2509 case 167:
2510 -#line 1277 "/usr/homes/chet/src/bash/src/parse.y"
2511 +#line 1282 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2512 { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
2513 break;
2516 /* Line 1267 of yacc.c. */
2517 -#line 3377 "y.tab.c"
2518 +#line 3382 "y.tab.c"
2519 default: break;
2521 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2522 @@ -3587,7 +3592,7 @@
2526 -#line 1279 "/usr/homes/chet/src/bash/src/parse.y"
2527 +#line 1284 "/usr/src/local/bash/bash-4.3-patched/parse.y"
2530 /* Initial size to allocate for tokens, and the
2531 @@ -4736,7 +4741,7 @@
2532 not already end in an EOF character. */
2533 if (shell_input_line_terminator != EOF)
2535 - if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
2536 + if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
2537 shell_input_line = (char *)xrealloc (shell_input_line,
2538 1 + (shell_input_line_size += 2));
2540 @@ -4845,6 +4850,16 @@
2541 eol_ungetc_lookahead = c;
2544 +char *
2545 +parser_remaining_input ()
2547 + if (shell_input_line == 0)
2548 + return 0;
2549 + if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
2550 + return '\0'; /* XXX */
2551 + return (shell_input_line + shell_input_line_index);
2554 #ifdef INCLUDE_UNUSED
2555 /* Back the input pointer up by one, effectively `ungetting' a character. */
2556 static void
2557 @@ -4948,13 +4963,28 @@
2558 which allow ESAC to be the next one read. */
2559 static int esacs_needed_count;
2561 +static void
2562 +push_heredoc (r)
2563 + REDIRECT *r;
2565 + if (need_here_doc >= HEREDOC_MAX)
2567 + last_command_exit_value = EX_BADUSAGE;
2568 + need_here_doc = 0;
2569 + report_syntax_error (_("maximum here-document count exceeded"));
2570 + reset_parser ();
2571 + exit_shell (last_command_exit_value);
2573 + redir_stack[need_here_doc++] = r;
2576 void
2577 gather_here_documents ()
2579 int r;
2581 r = 0;
2582 - while (need_here_doc)
2583 + while (need_here_doc > 0)
2585 parser_state |= PST_HEREDOC;
2586 make_here_document (redir_stack[r++], line_number);
2587 @@ -5265,6 +5295,8 @@
2588 FREE (word_desc_to_read);
2589 word_desc_to_read = (WORD_DESC *)NULL;
2591 + eol_ungetc_lookahead = 0;
2593 current_token = '\n'; /* XXX */
2594 last_read_token = '\n';
2595 token_to_read = '\n';
2596 @@ -5710,7 +5742,7 @@
2597 within a double-quoted ${...} construct "an even number of
2598 unescaped double-quotes or single-quotes, if any, shall occur." */
2599 /* This was changed in Austin Group Interp 221 */
2600 - if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
2601 + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
2602 continue;
2604 /* Could also check open == '`' if we want to parse grouping constructs
2605 @@ -6317,8 +6349,8 @@
2606 reset_parser ();
2607 /* reset_parser clears shell_input_line and associated variables */
2608 restore_input_line_state (&ls);
2609 - if (interactive)
2610 - token_to_read = 0;
2612 + token_to_read = 0;
2614 /* Need to find how many characters parse_and_execute consumed, update
2615 *indp, if flags != 0, copy the portion of the string parsed into RET
2616 @@ -8387,6 +8419,7 @@
2618 ps->expand_aliases = expand_aliases;
2619 ps->echo_input_at_read = echo_input_at_read;
2620 + ps->need_here_doc = need_here_doc;
2622 ps->token = token;
2623 ps->token_buffer_size = token_buffer_size;
2624 @@ -8435,6 +8468,7 @@
2626 expand_aliases = ps->expand_aliases;
2627 echo_input_at_read = ps->echo_input_at_read;
2628 + need_here_doc = ps->need_here_doc;
2630 FREE (token);
2631 token = ps->token;