]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/texinfo-4.8-multibyte-1.patch
core64: started update 64.
[people/teissler/ipfire-2.x.git] / src / patches / texinfo-4.8-multibyte-1.patch
CommitLineData
dd714b8a
MT
1Submitted By: Alexander E. Patrakov
2Date: 2005-07-12
3Initial Package Version: 4.8
4Upstream Status: Hack, won't submit
5Origin: Alexander E. Patrakov
6Description: Info assumes that a string width in character cells is the
7same as its length in bytes. This patch avoids cases when this assumption
8is not true.
9
10diff -ur texinfo-4.8/info/info.c texinfo-4.8.hacked/info/info.c
11--- texinfo-4.8/info/info.c 2004-04-11 23:56:45.000000000 +0600
12+++ texinfo-4.8.hacked/info/info.c 2005-07-12 12:11:34.852485776 +0600
13@@ -154,6 +154,10 @@
14 #ifdef HAVE_SETLOCALE
15 /* Set locale via LC_ALL. */
16 setlocale (LC_ALL, "");
17+ /* But don't use translated messages in the case when
18+ string width and length can differ */
19+ if (MB_CUR_MAX > 1)
20+ setlocale(LC_MESSAGES, "C");
21 #endif
22
23 #ifdef ENABLE_NLS
24diff -ur texinfo-4.8/info/man.c texinfo-4.8.hacked/info/man.c
25--- texinfo-4.8/info/man.c 2004-04-11 23:56:46.000000000 +0600
26+++ texinfo-4.8.hacked/info/man.c 2005-07-12 12:08:40.267026800 +0600
27@@ -325,6 +325,17 @@
28 freopen (NULL_DEVICE, "r", stdin);
29 dup2 (pipes[1], fileno (stdout));
30
31+ if (MB_CUR_MAX > 1)
32+ {
33+ /* Info has trouble wrapping man output if it contains
34+ multibyte characters */
35+ setenv("LANGUAGE", "C", 1);
36+ setenv("LANG", "C", 1);
37+ setenv("LC_MESSAGES", "C", 1);
38+ setenv("LC_CTYPE", "C", 1);
39+ setenv("LC_ALL", "C", 1);
40+ }
41+
42 execv (formatter_args[0], formatter_args);
43
44 /* If we get here, we couldn't exec, so close out the pipe and