about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/ispell/patches/0030-Display-whole-multibyte-character.patch
blob: bf687f04413ceffc4d33801682131a5d004f553e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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')
--