No specific user configuration
[platform/upstream/bash.git] / jobs.c
diff --git a/jobs.c b/jobs.c
index 2452779..f38b0c3 100644 (file)
--- a/jobs.c
+++ b/jobs.c
@@ -3597,6 +3597,7 @@ run_sigchld_trap (nchild)
   unwind_protect_int (jobs_list_frozen);
   unwind_protect_pointer (the_pipeline);
   unwind_protect_pointer (subst_assign_varlist);
+  unwind_protect_pointer (this_shell_builtin);
 
   /* We have to add the commands this way because they will be run
      in reverse order of adding.  We don't want maybe_set_sigchld_trap ()
@@ -4374,7 +4375,7 @@ without_job_control ()
 void
 end_job_control ()
 {
-  if (interactive_shell)               /* XXX - should it be interactive? */
+  if (interactive_shell || job_control)                /* XXX - should it be just job_control? */
     {
       terminate_stopped_jobs ();