From 819229fa50c936ec2d4376008d5b3a7b596cdbcd Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 1 Mar 2016 18:00:08 +0000 Subject: [PATCH] also flush syntax-failed or interrupted input into the history --- lex.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lex.c b/lex.c index 6b0b1bf..e0bc0d9 100644 --- a/lex.c +++ b/lex.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.219 2016/01/21 18:24:41 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.220 2016/03/01 18:00:08 tg Exp $"); /* * states while lexing word @@ -1359,8 +1359,10 @@ getsc_line(Source *s) ksh_tmout_state = TMOUT_READING; alarm(ksh_tmout); } - if (interactive) + if (interactive) { + histsave(&s->line, NULL, HIST_FLUSH, true); change_winsz(); + } #ifndef MKSH_NO_CMDLINE_EDITING if (have_tty && ( #if !MKSH_S_NOVI