From ee88838cf9421e2e40a7b7969cdf78a0010b075c Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 10 Jan 2017 17:05:14 -0500 Subject: [PATCH] commit bash-20170106 snapshot --- CWRU/CWRU.chlog | 17 +++++++++++++++++ execute_cmd.c | 1 + jobs.c | 2 +- sig.c | 3 ++- subst.c | 2 ++ tests/RUN-ONE-TEST | 2 +- 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 6c2cb420..e1826ba4 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -12956,3 +12956,20 @@ parser.h parse.y - xparse_dolparen: need ALIAS or DPAREN_ARITHMETIC to be defined to use STRING_SAVER + + 1/3 + --- +sig.c + - termsig_handler: don't call end_job_control if subshell_environment + indicates that we're in a command or process substitution. + Provisional fix for bug reported by Russell King + +jobs.c + - end_job_control: only attempt to give the terminal back to + original_pgrp if job_control != 0; don't test interactive_shell + +execute_cmd.c + - execute_disk_command: call QUIT after search_for_command, since + the only time QUIT gets called is when the path is actually + searched. It doesn't happen for an absolute pathname. Fix for + bug reported by Russell King diff --git a/execute_cmd.c b/execute_cmd.c index 03e6b836..feccf7c7 100644 --- a/execute_cmd.c +++ b/execute_cmd.c @@ -5212,6 +5212,7 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out, #endif /* RESTRICTED_SHELL */ command = search_for_command (pathname, CMDSRCH_HASH|(stdpath ? CMDSRCH_STDPATH : 0)); + QUIT; if (command) { diff --git a/jobs.c b/jobs.c index 657b84f1..90a7f212 100644 --- a/jobs.c +++ b/jobs.c @@ -4707,7 +4707,7 @@ without_job_control () void end_job_control () { - if (interactive_shell || job_control) /* XXX - should it be just job_control? */ + if (job_control) { terminate_stopped_jobs (); diff --git a/sig.c b/sig.c index 66509aab..aaaa10ee 100644 --- a/sig.c +++ b/sig.c @@ -570,7 +570,8 @@ termsig_handler (sig) #if defined (JOB_CONTROL) if (sig == SIGHUP && (interactive || (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)))) hangup_all_jobs (); - end_job_control (); + if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)) == 0) + end_job_control (); #endif /* JOB_CONTROL */ #if defined (PROCESS_SUBSTITUTION) diff --git a/subst.c b/subst.c index 06ee894c..03656d70 100644 --- a/subst.c +++ b/subst.c @@ -5882,7 +5882,9 @@ process_substitute (string, open_for_read_in_child) close (parent_pipe_fd); close (child_pipe_fd); #endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) restore_pipeline (1); +#endif return ((char *)NULL); } diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 554f3d6e..58c375b7 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/bash/bash-current +BUILD_DIR=/usr/local/build/chet/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR