mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-06 11:50:49 +02:00
commit bash-20201012 snapshot
This commit is contained in:
@@ -9073,3 +9073,25 @@ lib/readline/terminal.c
|
||||
- _rl_init_terminal_io: if the terminal name is "dumb", disable
|
||||
bracketed paste mode. Suggested by
|
||||
Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
10/13
|
||||
-----
|
||||
trap.[ch]
|
||||
- set_trap_state: new function to allow other signal handlers to set
|
||||
the internal state that trap_handler would set to note that the
|
||||
shell received a trapped signal. Used by sigint_sighandler().
|
||||
|
||||
sig.c
|
||||
- sigint_sighandler: call set_trap_state to set the pending trap state
|
||||
for SIGINT if trap_handler is not called. Needed because
|
||||
throw_to_top_level now checks whether a signal is pending before
|
||||
running the trap (change from 4/2020)
|
||||
|
||||
builtins/trap.def
|
||||
- trap_builtin: if the shell is interactive (interactive_shell != 0)
|
||||
but running something like PROMPT_COMMAND that sets
|
||||
parse_and_execute_level > 0 but interactive == 0, make sure to set
|
||||
the signal handler to the default interactive shell SIGINT handler
|
||||
(sigint_sighandler) instead of the default non-interactive one.
|
||||
Fixes bug reported by Daniel Farina <daniel@fdr.io> with a hint
|
||||
from felix <felix@f-hauri.ch>
|
||||
|
||||
+1
-1
@@ -211,7 +211,7 @@ trap_builtin (list)
|
||||
if (interactive)
|
||||
set_signal_handler (SIGINT, sigint_sighandler);
|
||||
/* special cases for interactive == 0 */
|
||||
else if (interactive_shell && (sourcelevel||running_trap))
|
||||
else if (interactive_shell && (sourcelevel||running_trap||parse_and_execute_level))
|
||||
set_signal_handler (SIGINT, sigint_sighandler);
|
||||
else
|
||||
set_signal_handler (SIGINT, termsig_sighandler);
|
||||
|
||||
@@ -669,6 +669,11 @@ sigint_sighandler (sig)
|
||||
SIGRETURN (0);
|
||||
}
|
||||
|
||||
/* In interactive shells, we will get here instead of trap_handler() so
|
||||
note that we have a trap pending. */
|
||||
if (signal_is_trapped (sig))
|
||||
set_trap_state (sig);
|
||||
|
||||
/* This is no longer used, but this code block remains as a reminder. */
|
||||
if (interrupt_immediately)
|
||||
{
|
||||
|
||||
@@ -7953,7 +7953,11 @@ parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, fl
|
||||
if (valid_parameter_transform (xform) == 0)
|
||||
{
|
||||
this_command_name = oname;
|
||||
#if 0 /* TAG: bash-5.2 Martin Schulte <gnu@schrader-schulte.de> 10/2020 */
|
||||
return (interactive_shell ? &expand_param_error : &expand_param_fatal);
|
||||
#else
|
||||
return &expand_param_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
starsub = vtype & VT_STARSUB;
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
echo "warning: the text of a system error message may vary between systems and" >&2
|
||||
echo "warning: produce diff output." >&2
|
||||
${THIS_SH} ./vredir.tests > ${BASH_TSTOUT} 2>&1
|
||||
diff ${BASH_TSTOUT} vredir.right && rm -f ${BASH_TSTOUT}
|
||||
|
||||
@@ -456,6 +456,17 @@ run_pending_traps ()
|
||||
last_command_exit_value = old_exit_value;
|
||||
}
|
||||
|
||||
/* Set the private state variables noting that we received a signal SIG
|
||||
for which we have a trap set. */
|
||||
void
|
||||
set_trap_state (sig)
|
||||
int sig;
|
||||
{
|
||||
catch_flag = 1;
|
||||
pending_traps[sig]++;
|
||||
trapped_signal_received = sig;
|
||||
}
|
||||
|
||||
sighandler
|
||||
trap_handler (sig)
|
||||
int sig;
|
||||
@@ -484,9 +495,7 @@ trap_handler (sig)
|
||||
set_signal_handler (sig, trap_handler);
|
||||
#endif /* MUST_REINSTALL_SIGHANDLERS */
|
||||
|
||||
catch_flag = 1;
|
||||
pending_traps[sig]++;
|
||||
trapped_signal_received = sig;
|
||||
set_trap_state (sig);
|
||||
|
||||
if (this_shell_builtin && (this_shell_builtin == wait_builtin))
|
||||
{
|
||||
|
||||
@@ -116,6 +116,8 @@ extern void set_signal_hard_ignored PARAMS((int));
|
||||
extern void set_signal_ignored PARAMS((int));
|
||||
extern int signal_in_progress PARAMS((int));
|
||||
|
||||
extern void set_trap_state PARAMS((int));
|
||||
|
||||
extern int next_pending_trap PARAMS((int));
|
||||
extern int first_pending_trap PARAMS((void));
|
||||
extern void clear_pending_traps PARAMS((void));
|
||||
|
||||
Reference in New Issue
Block a user