7 Bug-Reported-by: Ian A Watson <WATSON_IAN_A@LILLY.COM>
8 Bug-Reference-ID: <OFEC551808.69D02C7F-ON8525729A.0045708D-8525729A.0046150B@EliLilly.lilly.com>
13 In some cases of error processing, a jump back to the top-level processing
14 loop from a builtin command would leave the shell in an inconsistent state.
18 *** ../bash-3.2-patched/sig.c Wed Jan 25 14:57:59 2006
19 --- bash-3.2/sig.c Sat Mar 10 11:11:30 2007
25 + /* Run some of the cleanups that should be performed when we run
26 + jump_to_top_level from a builtin command context. XXX - might want to
27 + also call reset_parser here. */
29 + top_level_cleanup ()
31 + /* Clean up string parser environment. */
32 + while (parse_and_execute_level)
33 + parse_and_execute_cleanup ();
35 + #if defined (PROCESS_SUBSTITUTION)
36 + unlink_fifo_list ();
37 + #endif /* PROCESS_SUBSTITUTION */
39 + run_unwind_protects ();
40 + loop_level = continuing = breaking = 0;
41 + return_catch_flag = 0;
44 /* What to do when we've been interrupted, and it is safe to handle it. */
46 *** ../bash-3.2-patched/sig.h Wed Jan 25 14:50:27 2006
47 --- bash-3.2/sig.h Sat Mar 10 11:14:18 2007
51 extern void initialize_terminating_signals __P((void));
52 extern void reset_terminating_signals __P((void));
53 + extern void top_level_cleanup __P((void));
54 extern void throw_to_top_level __P((void));
55 extern void jump_to_top_level __P((int)) __attribute__((__noreturn__));
56 *** ../bash-3.2-patched/builtins/common.c Tue Apr 3 16:47:13 2007
57 --- bash-3.2/builtins/common.c Mon Apr 30 15:01:33 2007
62 builtin_error (_("too many arguments"));
63 + top_level_cleanup ();
64 jump_to_top_level (DISCARD);
68 throw_to_top_level ();
70 ! jump_to_top_level (DISCARD);
74 throw_to_top_level ();
77 ! top_level_cleanup ();
78 ! jump_to_top_level (DISCARD);
82 *** ../bash-3.2-patched/subst.c Tue Apr 3 16:47:19 2007
83 --- bash-3.2/subst.c Tue Jul 17 09:45:11 2007
86 if (no_longjmp_on_fatal_error == 0)
88 ! report_error ("bad substitution: no closing `%s' in %s", "}", string);
89 last_command_exit_value = EXECUTION_FAILURE;
90 exp_jump_to_top_level (DISCARD);
92 if (no_longjmp_on_fatal_error == 0)
94 ! report_error (_("bad substitution: no closing `%s' in %s"), "}", string);
95 last_command_exit_value = EXECUTION_FAILURE;
96 exp_jump_to_top_level (DISCARD);
100 expand_no_split_dollar_star = 0; /* XXX */
103 + top_level_cleanup (); /* from sig.c */
105 jump_to_top_level (v);
109 report_error (_("no match: %s"), tlist->word->word);
110 ! jump_to_top_level (DISCARD);
112 else if (allow_null_glob_expansion == 0)
115 report_error (_("no match: %s"), tlist->word->word);
116 ! exp_jump_to_top_level (DISCARD);
118 else if (allow_null_glob_expansion == 0)
119 *** ../bash-3.2-patched/arrayfunc.c Thu Jul 27 09:37:59 2006
120 --- bash-3.2/arrayfunc.c Thu May 31 11:55:46 2007
125 last_command_exit_value = EXECUTION_FAILURE;
127 + top_level_cleanup ();
128 jump_to_top_level (DISCARD);
130 *** ../bash-3.2-patched/expr.c Wed Dec 28 17:47:03 2005
131 --- bash-3.2/expr.c Tue Apr 24 14:17:59 2007
137 + top_level_cleanup ();
138 jump_to_top_level (DISCARD);
140 *** ../bash-3.2-patched/variables.c Fri Sep 8 13:33:32 2006
141 --- bash-3.2/variables.c Tue Jul 17 09:54:59 2007
144 lval = evalexp (oval, &expok); /* ksh93 seems to do this */
146 ! jump_to_top_level (DISCARD);
148 rval = evalexp (value, &expok);
150 ! jump_to_top_level (DISCARD);
151 if (flags & ASS_APPEND)
154 lval = evalexp (oval, &expok); /* ksh93 seems to do this */
157 ! top_level_cleanup ();
158 ! jump_to_top_level (DISCARD);
161 rval = evalexp (value, &expok);
164 ! top_level_cleanup ();
165 ! jump_to_top_level (DISCARD);
167 if (flags & ASS_APPEND)
169 *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
170 --- bash-3.2/patchlevel.h Mon Oct 16 14:22:54 2006
173 looks for to find the patch level (for the sccs version string). */
175 ! #define PATCHLEVEL 19
177 #endif /* _PATCHLEVEL_H_ */
179 looks for to find the patch level (for the sccs version string). */
181 ! #define PATCHLEVEL 20
183 #endif /* _PATCHLEVEL_H_ */