Commit 4c6956b4 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

add minor fixes to make the displaying of invalid multibyte sequences

work again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2249 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 6 deletions
+5 -6
......@@ -150,7 +150,7 @@ char *control_mbrep(const char *c, char *crep, int *crep_len)
if (c_mb_len <= 0) {
mbtowc(NULL, NULL, 0);
wc = *c;
wc = (unsigned char)*c;
}
wcrep = control_wrep(wc);
......@@ -237,14 +237,13 @@ char *make_mbchar(unsigned int chr, char *chr_mb, int *chr_mb_len)
*chr_mb_len = wctomb(chr_mb, chr);
if (*chr_mb_len <= 0) {
mbtowc(NULL, NULL, 0);
*chr_mb_len = 1;
chr_mb[0] = (unsigned char)chr;
wctomb(NULL, 0);
*chr_mb_len = 0;
}
} else {
#endif
*chr_mb_len = 1;
chr_mb[0] = (unsigned char)chr;
chr_mb[0] = (char)chr;
#ifdef NANO_WIDE
}
#endif
......
......@@ -2190,7 +2190,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
char *bad_buf_mb = charalloc(mb_cur_max());
int bad_buf_mb_len;
bad_buf_mb = make_mbchar((unsigned int)*buf_mb,
bad_buf_mb = make_mbchar((unsigned char)*buf_mb,
bad_buf_mb, &bad_buf_mb_len);
for (i = 0; i < bad_buf_mb_len; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment