Skip to content

Commit 68e7a42

Browse files
Nicolas Pitregregkh
authored andcommitted
vt: make sure displayed double-width characters are remembered as such
And to do so we ensure the Unicode screen buffer is initialized when double-width characters are encountered. Signed-off-by: Nicolas Pitre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a16014c commit 68e7a42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/tty/vt/vt.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2930,8 +2930,15 @@ static int vc_process_ucs(struct vc_data *vc, int *c, int *tc)
29302930
{
29312931
u32 prev_c, curr_c = *c;
29322932

2933-
if (ucs_is_double_width(curr_c))
2933+
if (ucs_is_double_width(curr_c)) {
2934+
/*
2935+
* The Unicode screen memory is allocated only when
2936+
* required. This is one such case as we need to remember
2937+
* which displayed characters are double-width.
2938+
*/
2939+
vc_uniscr_check(vc);
29342940
return 2;
2941+
}
29352942

29362943
if (!ucs_is_zero_width(curr_c))
29372944
return 1;

0 commit comments

Comments
 (0)