Commit 68e7a421 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Greg Kroah-Hartman
Browse files

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: default avatarNicolas Pitre <npitre@baylibre.com>
Link: https://lore.kernel.org/r/20250507141535.40655-3-nico@fluxnic.net


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a16014c0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2930,8 +2930,15 @@ static int vc_process_ucs(struct vc_data *vc, int *c, int *tc)
{
	u32 prev_c, curr_c = *c;

	if (ucs_is_double_width(curr_c))
	if (ucs_is_double_width(curr_c)) {
		/*
		 * The Unicode screen memory is allocated only when
		 * required. This is one such case as we need to remember
		 * which displayed characters are double-width.
		 */
		vc_uniscr_check(vc);
		return 2;
	}

	if (!ucs_is_zero_width(curr_c))
		return 1;