From: David Lawrence Ramsey Date: Tue, 14 Jun 2005 02:08:25 +0000 (+0000) Subject: yet *another* cleanup X-Git-Tag: v1.3.8~145 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6209e0eb157fa3009f7faed64e1d0a9fb0f8f359;p=nano.git yet *another* cleanup git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2658 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/chars.c b/src/chars.c index 85f01670..3b7bf6c6 100644 --- a/src/chars.c +++ b/src/chars.c @@ -183,7 +183,7 @@ char *control_mbrep(const char *c, char *crep, int *crep_len) #ifdef NANO_WIDE if (!ISSET(NO_UTF8)) { - wchar_t wc, wcrep; + wchar_t wc; int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX), crep_mb_len; if (c_mb_len <= 0) { @@ -191,9 +191,7 @@ char *control_mbrep(const char *c, char *crep, int *crep_len) wc = (unsigned char)*c; } - wcrep = control_wrep(wc); - - crep_mb_len = wctomb(crep, wcrep); + crep_mb_len = wctomb(crep, control_wrep(wc)); if (crep_mb_len <= 0) { wctomb(NULL, 0); @@ -228,6 +226,7 @@ int mbwidth(const char *c) } width = wcwidth(wc); + if (width == -1) width++;