nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 6209e0eb157fa3009f7faed64e1d0a9fb0f8f359
parent e534aae70161c4acabffcea9af7da7e9f1dbf0e9
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Tue, 14 Jun 2005 02:08:25 +0000

yet *another* cleanup


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2658 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
Msrc/chars.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 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++;