From: Greg Kroah-Hartman Date: Sat, 26 Apr 2025 09:21:12 +0000 (+0200) Subject: Revert "vt: remove zero-white-space handling from conv_uni_to_pc()" X-Git-Tag: v6.16-rc1~29^2~56 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=ab67c4622c3618edc35e623b53a0fd1a0a1ef062;p=linux-block.git Revert "vt: remove zero-white-space handling from conv_uni_to_pc()" This reverts commit b35f7a773cbcbfea3bc87a33c7d0f39e34ed83ec. A new version of the series was submitted, so it's easier to revert the old one and add the new one due to the changes invovled. Cc: Nicolas Pitre Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index bb4bb272ebec..82d70083fead 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -870,6 +870,8 @@ int conv_uni_to_pc(struct vc_data *conp, long ucs) return -4; /* Not found */ else if (ucs < 0x20) return -1; /* Not a printable character */ + else if (ucs == 0xfeff || (ucs >= 0x200b && ucs <= 0x200f)) + return -2; /* Zero-width space */ /* * UNI_DIRECT_BASE indicates the start of the region in the User Zone * which always has a 1:1 mapping to the currently loaded font. The diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 0d1d663c7809..dc84f9c6b7c6 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2964,15 +2964,13 @@ static int vc_con_write_normal(struct vc_data *vc, int tc, int c, goto out; } } - /* padding for the legacy display like done below */ - tc = ' '; } } /* Now try to find out how to display it */ tc = conv_uni_to_pc(vc, tc); if (tc & ~charmask) { - if (tc == -1) + if (tc == -1 || tc == -2) return -1; /* nothing to display */ /* Glyph not found */