make certain actions flush the history buffer

This commit is contained in:
tg
2015-07-05 19:53:46 +00:00
parent e0196f47d5
commit 2e4cd72899
2 changed files with 19 additions and 3 deletions

6
lex.c
View File

@@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.203 2015/07/05 19:37:16 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.204 2015/07/05 19:53:46 tg Exp $");
/*
* states while lexing word
@@ -1474,8 +1474,10 @@ getsc_line(Source *s)
cp = Xstring(s->xs, xp);
while (*cp && ctype(*cp, C_IFSWS))
++cp;
if (!*cp)
if (!*cp) {
histsave(&s->line, NULL, HIST_FLUSH, true);
histsync();
}
#endif
}
if (interactive)