yet *another* cleanup

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2658 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-06-14 02:08:25 +00:00
parent e534aae701
commit 6209e0eb15
1 changed files with 3 additions and 4 deletions

View File

@ -183,7 +183,7 @@ char *control_mbrep(const char *c, char *crep, int *crep_len)
#ifdef NANO_WIDE #ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) { if (!ISSET(NO_UTF8)) {
wchar_t wc, wcrep; wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX), crep_mb_len; int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX), crep_mb_len;
if (c_mb_len <= 0) { if (c_mb_len <= 0) {
@ -191,9 +191,7 @@ char *control_mbrep(const char *c, char *crep, int *crep_len)
wc = (unsigned char)*c; wc = (unsigned char)*c;
} }
wcrep = control_wrep(wc); crep_mb_len = wctomb(crep, control_wrep(wc));
crep_mb_len = wctomb(crep, wcrep);
if (crep_mb_len <= 0) { if (crep_mb_len <= 0) {
wctomb(NULL, 0); wctomb(NULL, 0);
@ -228,6 +226,7 @@ int mbwidth(const char *c)
} }
width = wcwidth(wc); width = wcwidth(wc);
if (width == -1) if (width == -1)
width++; width++;