fix for SIGINT in sourced script

This commit is contained in:
Chet Ramey
2018-06-01 10:22:36 -04:00
parent 34dbca51a5
commit 6444760999
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -98,6 +98,7 @@ static int display_traps __P((WORD_LIST *));
#define IGNORE 2 /* Ignore this signal. */
extern int posixly_correct, subshell_environment;
extern int sourcelevel, running_trap;
int
trap_builtin (list)
@@ -212,6 +213,9 @@ trap_builtin (list)
was SIG_IGN? */
if (interactive)
set_signal_handler (SIGINT, sigint_sighandler);
/* special cases for interactive == 0 */
else if (interactive_shell && (sourcelevel||running_trap))
set_signal_handler (SIGINT, sigint_sighandler);
else
set_signal_handler (SIGINT, termsig_sighandler);
break;
+1 -1
View File
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
#define PATCHLEVEL 22
#define PATCHLEVEL 23
#endif /* _PATCHLEVEL_H_ */