nixpkgs/pkgs/tools/text/ispell/patches/0030-Display-whole-multibyte-character.patch
2018-03-01 23:54:04 +01: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')
--