summaryrefslogtreecommitdiffstats
path: root/enter.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-05-09 15:19:26 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-05-09 15:19:26 +0000
commit3de049372c8ca458e096b8c8ece2d4f95da0fe82 (patch)
treebedf3c7648d8815163ff60f0a557a554fdc32545 /enter.c
parentee09e5f42399a6016f3e96dcbd03bab1effa07ff (diff)
Edmund Grimley Evans' UTF-8 patch.
Diffstat (limited to 'enter.c')
-rw-r--r--enter.c7
1 files changed, 5 insertions, 2 deletions
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);