|
|
ff19ae |
BASH PATCH REPORT
|
|
|
ff19ae |
=================
|
|
|
ff19ae |
|
|
|
ff19ae |
Bash-Release: 4.2
|
|
|
ff19ae |
Patch-ID: bash42-008
|
|
|
ff19ae |
|
|
|
ff19ae |
Bug-Reported-by: Doug McMahon <mc2man@optonline.net>
|
|
|
ff19ae |
Bug-Reference-ID: <1299441211.2535.11.camel@doug-XPS-M1330>
|
|
|
ff19ae |
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-03/msg00050.html
|
|
|
ff19ae |
|
|
|
ff19ae |
Bug-Description:
|
|
|
ff19ae |
|
|
|
ff19ae |
Bash-4.2 does not attempt to save the shell history on receipt of a
|
|
|
ff19ae |
terminating signal that is handled synchronously. Unfortunately, the
|
|
|
ff19ae |
`close' button on most X11 terminal emulators sends SIGHUP, which
|
|
|
ff19ae |
kills the shell.
|
|
|
ff19ae |
|
|
|
ff19ae |
This is a very small patch to save the history in the case that an
|
|
|
ff19ae |
interactive shell receives a SIGHUP or SIGTERM while in readline and
|
|
|
ff19ae |
reading a command.
|
|
|
ff19ae |
|
|
|
ff19ae |
The next version of bash will do this differently.
|
|
|
ff19ae |
|
|
|
ff19ae |
Patch (apply with `patch -p0'):
|
|
|
ff19ae |
|
|
|
ff19ae |
*** ../bash-4.2-patched/sig.c Tue Nov 23 08:21:22 2010
|
|
|
ff19ae |
--- sig.c Tue Mar 8 21:28:32 2011
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 47,50 ****
|
|
|
ff19ae |
--- 47,51 ----
|
|
|
ff19ae |
#if defined (READLINE)
|
|
|
ff19ae |
# include "bashline.h"
|
|
|
ff19ae |
+ # include <readline/readline.h>
|
|
|
ff19ae |
#endif
|
|
|
ff19ae |
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 63,66 ****
|
|
|
ff19ae |
--- 64,68 ----
|
|
|
ff19ae |
extern int history_lines_this_session;
|
|
|
ff19ae |
#endif
|
|
|
ff19ae |
+ extern int no_line_editing;
|
|
|
ff19ae |
|
|
|
ff19ae |
extern void initialize_siglist ();
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 506,510 ****
|
|
|
ff19ae |
#if defined (HISTORY)
|
|
|
ff19ae |
/* XXX - will inhibit history file being written */
|
|
|
ff19ae |
! history_lines_this_session = 0;
|
|
|
ff19ae |
#endif
|
|
|
ff19ae |
terminate_immediately = 0;
|
|
|
ff19ae |
--- 508,515 ----
|
|
|
ff19ae |
#if defined (HISTORY)
|
|
|
ff19ae |
/* XXX - will inhibit history file being written */
|
|
|
ff19ae |
! # if defined (READLINE)
|
|
|
ff19ae |
! if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0))
|
|
|
ff19ae |
! # endif
|
|
|
ff19ae |
! history_lines_this_session = 0;
|
|
|
ff19ae |
#endif
|
|
|
ff19ae |
terminate_immediately = 0;
|
|
|
ff19ae |
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
|
|
ff19ae |
--- patchlevel.h Thu Feb 24 21:41:34 2011
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 26,30 ****
|
|
|
ff19ae |
looks for to find the patch level (for the sccs version string). */
|
|
|
ff19ae |
|
|
|
ff19ae |
! #define PATCHLEVEL 7
|
|
|
ff19ae |
|
|
|
ff19ae |
#endif /* _PATCHLEVEL_H_ */
|
|
|
ff19ae |
--- 26,30 ----
|
|
|
ff19ae |
looks for to find the patch level (for the sccs version string). */
|
|
|
ff19ae |
|
|
|
ff19ae |
! #define PATCHLEVEL 8
|
|
|
ff19ae |
|
|
|
ff19ae |
#endif /* _PATCHLEVEL_H_ */
|