From: David Lawrence Ramsey Date: Wed, 5 Jan 2005 18:33:04 +0000 (+0000) Subject: when NANO_WIDE is defined, use MB_CUR_MAX only when the NO_UTF8 flag is X-Git-Tag: v1.3.6~166 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8ec1e2d903024eb16db97d321872bb08a22b7c14;p=nano.git when NANO_WIDE is defined, use MB_CUR_MAX only when the NO_UTF8 flag is not set git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2236 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/winio.c b/src/winio.c index b4a143cb..a7007e59 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2288,13 +2288,12 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool alloc_len = display_string_len(buf + start_index, start_col, start_col + len); - alloc_len += #ifdef NANO_WIDE - MB_CUR_MAX -#else - 1 + if (!ISSET(NO_UTF8)) + alloc_len += MB_CUR_MAX * 2; + else #endif - * 2; + alloc_len += 2; converted = charalloc(alloc_len + 1); index = 0;