bash-4.2-008.patch 2.1 KB

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