From 95d8b617ae223980cf5944588881d0a35736981e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 9 Mar 2002 17:54:38 +0000 Subject: [PATCH] Irssi didn't work properly if read() returned only partial utf8 character string. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2544 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/term-terminfo.c | 4 ++-- 1 file 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; } }