From 3ccc19a962e52bcae71e3d5a5de7ffcceb978c20 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 8 Dec 2012 00:34:11 -0800 Subject: [PATCH] applying bash42-008 --- patchlevel.h | 2 +- sig.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/patchlevel.h b/patchlevel.h index 52efbd7..2352c1c 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -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 7 +#define PATCHLEVEL 8 #endif /* _PATCHLEVEL_H_ */ diff --git a/sig.c b/sig.c index 6bd1319..d38246d 100644 --- a/sig.c +++ b/sig.c @@ -46,6 +46,7 @@ #if defined (READLINE) # include "bashline.h" +# include #endif #if defined (HISTORY) @@ -62,6 +63,7 @@ extern int parse_and_execute_level, shell_initialized; #if defined (HISTORY) extern int history_lines_this_session; #endif +extern int no_line_editing; extern void initialize_siglist (); @@ -505,7 +507,10 @@ termsig_sighandler (sig) { #if defined (HISTORY) /* XXX - will inhibit history file being written */ - history_lines_this_session = 0; +# if defined (READLINE) + if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0)) +# endif + history_lines_this_session = 0; #endif terminate_immediately = 0; termsig_handler (sig); -- 2.7.4