From: Chet Ramey Date: Wed, 23 Nov 2011 01:00:47 +0000 (-0500) Subject: Bash-4.2 patch 8 X-Git-Tag: bash-4.3~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5d0096115d0d484fd669ad170498962ea45e841;p=thirdparty%2Fbash.git Bash-4.2 patch 8 --- diff --git a/patchlevel.h b/patchlevel.h index 52efbd769..2352c1ca3 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 6bd1319b9..d38246d29 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);