1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/tools/text/ispell/patches/0030-Display-whole-multibyte-character.patch

36 lines
914 B
Diff
Raw Normal View History

2014-07-19 12:37:08 +01:00
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')
--