aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index bbd9fc412877..6650ae1c088f 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -1956,7 +1956,7 @@ char con_buf[CON_BUF_SIZE];
1956DEFINE_MUTEX(con_buf_mtx); 1956DEFINE_MUTEX(con_buf_mtx);
1957 1957
1958/* is_double_width() is based on the wcwidth() implementation by 1958/* is_double_width() is based on the wcwidth() implementation by
1959 * Markus Kuhn -- 2003-05-20 (Unicode 4.0) 1959 * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
1960 * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c 1960 * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
1961 */ 1961 */
1962struct interval { 1962struct interval {
@@ -1988,8 +1988,8 @@ static int is_double_width(uint32_t ucs)
1988 static const struct interval double_width[] = { 1988 static const struct interval double_width[] = {
1989 { 0x1100, 0x115F }, { 0x2329, 0x232A }, { 0x2E80, 0x303E }, 1989 { 0x1100, 0x115F }, { 0x2329, 0x232A }, { 0x2E80, 0x303E },
1990 { 0x3040, 0xA4CF }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFAFF }, 1990 { 0x3040, 0xA4CF }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFAFF },
1991 { 0xFE30, 0xFE6F }, { 0xFF00, 0xFF60 }, { 0xFFE0, 0xFFE6 }, 1991 { 0xFE10, 0xFE19 }, { 0xFE30, 0xFE6F }, { 0xFF00, 0xFF60 },
1992 { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD } 1992 { 0xFFE0, 0xFFE6 }, { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD }
1993 }; 1993 };
1994 return bisearch(ucs, double_width, 1994 return bisearch(ucs, double_width,
1995 sizeof(double_width) / sizeof(*double_width) - 1); 1995 sizeof(double_width) / sizeof(*double_width) - 1);
@@ -2187,9 +2187,12 @@ rescan_last_byte:
2187 continue; /* nothing to display */ 2187 continue; /* nothing to display */
2188 } 2188 }
2189 /* Glyph not found */ 2189 /* Glyph not found */
2190 if (!(vc->vc_utf && !vc->vc_disp_ctrl) && !(c & ~charmask)) { 2190 if ((!(vc->vc_utf && !vc->vc_disp_ctrl) || c < 128) && !(c & ~charmask)) {
2191 /* In legacy mode use the glyph we get by a 1:1 mapping. 2191 /* In legacy mode use the glyph we get by a 1:1 mapping.
2192 This would make absolutely no sense with Unicode in mind. */ 2192 This would make absolutely no sense with Unicode in mind,
2193 but do this for ASCII characters since a font may lack
2194 Unicode mapping info and we don't want to end up with
2195 having question marks only. */
2193 tc = c; 2196 tc = c;
2194 } else { 2197 } else {
2195 /* Display U+FFFD. If it's not found, display an inverse question mark. */ 2198 /* Display U+FFFD. If it's not found, display an inverse question mark. */
@@ -2213,6 +2216,7 @@ rescan_last_byte:
2213 } else { 2216 } else {
2214 vc_attr = ((vc->vc_attr) & 0x88) | (((vc->vc_attr) & 0x70) >> 4) | (((vc->vc_attr) & 0x07) << 4); 2217 vc_attr = ((vc->vc_attr) & 0x88) | (((vc->vc_attr) & 0x70) >> 4) | (((vc->vc_attr) & 0x07) << 4);
2215 } 2218 }
2219 FLUSH
2216 } 2220 }
2217 2221
2218 while (1) { 2222 while (1) {
@@ -2246,6 +2250,10 @@ rescan_last_byte:
2246 if (tc < 0) tc = ' '; 2250 if (tc < 0) tc = ' ';
2247 } 2251 }
2248 2252
2253 if (inverse) {
2254 FLUSH
2255 }
2256
2249 if (rescan) { 2257 if (rescan) {
2250 rescan = 0; 2258 rescan = 0;
2251 inverse = 0; 2259 inverse = 0;