depot/third_party/nixpkgs/pkgs/tools/text/ispell/patches/0030-Display-whole-multibyte-character.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

35 lines
914 B
Diff

From: Robert Luberda <robert@debian.org>
Date: Mon, 21 Mar 2011 10:36:15 +0100
Subject: 0030 Display whole multibyte character
Display all bytes from multibyte characters instead of converting them
into `cat -v' format. This fixes an ugly screen content shown while
checking UTF-8 files.
---
correct.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/correct.c b/correct.c
index 982b7c6..c91b41b 100644
--- a/correct.c
+++ b/correct.c
@@ -733,11 +733,14 @@ static int show_char (cp, linew, output, maxw)
ichar = SET_SIZE + laststringch;
else
ichar = chartoichar (ch);
- if (!vflag && iswordch (ichar) && len == 1)
+ if (!vflag && iswordch (ichar) && len >= 1)
{
- if (output)
- (void) putchar (ch);
- (*cp)++;
+ for (i = 0; i < len; ++i)
+ {
+ if (output)
+ (void) putchar (**cp);
+ (*cp)++;
+ }
return 1;
}
if (ch == '\t')
--