lineedit: add support for history saving on exit

Based on the patch by Dennis Groenen <tj.groenen@gmail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2011-09-04 16:12:33 +02:00
parent 4840ae8a06
commit bede215cf1
5 changed files with 86 additions and 6 deletions

View File

@@ -1541,6 +1541,10 @@ static sighandler_t pick_sighandler(unsigned sig)
static void hush_exit(int exitcode) NORETURN;
static void hush_exit(int exitcode)
{
#if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT
save_history(G.line_input_state);
#endif
fflush_all();
if (G.exiting <= 0 && G.traps && G.traps[0] && G.traps[0][0]) {
char *argv[3];