summaryrefslogtreecommitdiff
path: root/sig.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-07 09:04:35 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-07 09:04:35 -0500
commit6ec48275ead1ddc961c08c9d450fe3c807182c8e (patch)
tree406d955a1d85d0451420c3c76e92b866ae997847 /sig.c
parentb5fabbae5cded9747259fa0b154a5d0729899d62 (diff)
downloadbash-6ec48275ead1ddc961c08c9d450fe3c807182c8e.tar.gz
commit bash-20070308 snapshot
Diffstat (limited to 'sig.c')
-rw-r--r--sig.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sig.c b/sig.c
index 2bd6cae6..d3067dda 100644
--- a/sig.c
+++ b/sig.c
@@ -350,6 +350,25 @@ reset_terminating_signals ()
#undef XSIG
#undef XHANDLER
+/* Run some of the cleanups that should be performed when we run
+ jump_to_top_level from a builtin command context. XXX - might want to
+ also call reset_parser here. */
+void
+top_level_cleanup ()
+{
+ /* Clean up string parser environment. */
+ while (parse_and_execute_level)
+ parse_and_execute_cleanup ();
+
+#if defined (PROCESS_SUBSTITUTION)
+ unlink_fifo_list ();
+#endif /* PROCESS_SUBSTITUTION */
+
+ run_unwind_protects ();
+ loop_level = continuing = breaking = 0;
+ return_catch_flag = 0;
+}
+
/* What to do when we've been interrupted, and it is safe to handle it. */
void
throw_to_top_level ()
@@ -372,7 +391,7 @@ throw_to_top_level ()
/* Run any traps set on SIGINT. */
run_interrupt_trap ();
- /* Cleanup string parser environment. */
+ /* Clean up string parser environment. */
while (parse_and_execute_level)
parse_and_execute_cleanup ();