summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fe-text/term-terminfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index 43d11375..30f7d11b 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -630,9 +630,9 @@ int term_gets(unichar *buffer, int size)
if (i >= term_inbuf_pos)
term_inbuf_pos = 0;
- else {
+ else if (i > 0) {
memmove(term_inbuf+i, term_inbuf, term_inbuf_pos-i);
- term_inbuf_pos = i;
+ term_inbuf_pos -= i;
}
}