diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-11-22 20:00:47 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-11-22 20:00:47 -0500 |
commit | d5d0096115d0d484fd669ad170498962ea45e841 (patch) | |
tree | 09641a3465004f0838978a1f93d1acb3c3e1df7f /sig.c | |
parent | 1cc068989c89ffa51f6cd7219c826c0bb345f0f8 (diff) | |
download | bash-d5d0096115d0d484fd669ad170498962ea45e841.tar.gz |
Bash-4.2 patch 8
Diffstat (limited to 'sig.c')
-rw-r--r-- | sig.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -46,6 +46,7 @@ #if defined (READLINE) # include "bashline.h" +# include <readline/readline.h> #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); |