From 931d37617fe7bebe276b7a6eed65b43a77120a6e Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Sat, 23 Jun 2007 17:16:27 -0700 Subject: [PATCH] --- yaml --- r: 57979 b: refs/heads/master c: 1ed8a2b3c501bedd4b35130c8a52662ccf78abad h: refs/heads/master i: 57977: f5751e44022a2f8a0cee9949254c0ccd08fe7cae 57975: a2bb7c786f1e9e1ee498fd79ecc2c6e6ffa1d4d0 v: v3 --- [refs] | 2 +- trunk/drivers/char/vt.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 1ba6ca93540a..d18996c6622d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4e71e474c784dc274f28ec8bb22a5dbabc6dc7c5 +refs/heads/master: 1ed8a2b3c501bedd4b35130c8a52662ccf78abad diff --git a/trunk/drivers/char/vt.c b/trunk/drivers/char/vt.c index bbd9fc412877..6650ae1c088f 100644 --- a/trunk/drivers/char/vt.c +++ b/trunk/drivers/char/vt.c @@ -1956,7 +1956,7 @@ char con_buf[CON_BUF_SIZE]; DEFINE_MUTEX(con_buf_mtx); /* is_double_width() is based on the wcwidth() implementation by - * Markus Kuhn -- 2003-05-20 (Unicode 4.0) + * Markus Kuhn -- 2007-05-26 (Unicode 5.0) * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c */ struct interval { @@ -1988,8 +1988,8 @@ static int is_double_width(uint32_t ucs) static const struct interval double_width[] = { { 0x1100, 0x115F }, { 0x2329, 0x232A }, { 0x2E80, 0x303E }, { 0x3040, 0xA4CF }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFAFF }, - { 0xFE30, 0xFE6F }, { 0xFF00, 0xFF60 }, { 0xFFE0, 0xFFE6 }, - { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD } + { 0xFE10, 0xFE19 }, { 0xFE30, 0xFE6F }, { 0xFF00, 0xFF60 }, + { 0xFFE0, 0xFFE6 }, { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD } }; return bisearch(ucs, double_width, sizeof(double_width) / sizeof(*double_width) - 1); @@ -2187,9 +2187,12 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co continue; /* nothing to display */ } /* Glyph not found */ - if (!(vc->vc_utf && !vc->vc_disp_ctrl) && !(c & ~charmask)) { + if ((!(vc->vc_utf && !vc->vc_disp_ctrl) || c < 128) && !(c & ~charmask)) { /* In legacy mode use the glyph we get by a 1:1 mapping. - This would make absolutely no sense with Unicode in mind. */ + This would make absolutely no sense with Unicode in mind, + but do this for ASCII characters since a font may lack + Unicode mapping info and we don't want to end up with + having question marks only. */ tc = c; } else { /* Display U+FFFD. If it's not found, display an inverse question mark. */ @@ -2213,6 +2216,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co } else { vc_attr = ((vc->vc_attr) & 0x88) | (((vc->vc_attr) & 0x70) >> 4) | (((vc->vc_attr) & 0x07) << 4); } + FLUSH } while (1) { @@ -2246,6 +2250,10 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co if (tc < 0) tc = ' '; } + if (inverse) { + FLUSH + } + if (rescan) { rescan = 0; inverse = 0;