From 3de049372c8ca458e096b8c8ece2d4f95da0fe82 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 9 May 2000 15:19:26 +0000 Subject: Edmund Grimley Evans' UTF-8 patch. --- enter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'enter.c') diff --git a/enter.c b/enter.c index 716d0ef7..46786199 100644 --- a/enter.c +++ b/enter.c @@ -124,8 +124,11 @@ int _mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x, j = begin; } move (y, x + j - begin); - for (; j < lastchar && j < begin + width; j++) - ADDCH (buf[j]); + { + int n = (lastchar < begin + width) ? lastchar : begin + width; + n = (n > j) ? n - j : 0; + addnstr ((char *)&buf[j], n); + } clrtoeol (); if (redraw != M_REDRAW_INIT) move (y, x + curpos - begin); -- cgit v1.2.3