about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/hist.c2
-rw-r--r--Src/input.c14
2 files changed, 16 insertions, 0 deletions
diff --git a/Src/hist.c b/Src/hist.c
index f1f240d3d..a25354f07 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -290,6 +290,8 @@ safeinungetc(int c)
 void
 herrflush(void)
 {
+    inpopalias();
+
     while (!lexstop && inbufct && !strin)
 	hwaddc(ingetc());
 }
diff --git a/Src/input.c b/Src/input.c
index e712ad19a..08ad4eb87 100644
--- a/Src/input.c
+++ b/Src/input.c
@@ -549,3 +549,17 @@ inpop(void)
 	inpoptop();
     } while (remcont);
 }
+
+/*
+ * Expunge any aliases from the input stack; they shouldn't appear
+ * in the history and need to be flushed explicitly when we encounter
+ * an error.
+ */
+
+/**/
+void
+inpopalias(void)
+{
+    while (inbufflags & INP_ALIAS)
+	inpoptop();
+}