about summary refs log tree commit diff
path: root/Src/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 3dde19845..e869e3a2e 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2102,6 +2102,11 @@ bufferwords(LinkList list, char *buf, int *index)
 	    cur = num - 1;
 	}
     } while (tok != ENDINPUT && tok != LEXERR);
+    if (buf && tok == LEXERR && tokstr && *tokstr) {
+	untokenize((p = dupstring(tokstr)));
+	addlinknode(list, p);
+	num++;
+    }
     if (cur < 0 && num)
 	cur = num - 1;
     noaliases = 0;