summaryrefslogtreecommitdiff
path: root/russian/rux
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2009-05-22 01:41:10 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2009-05-22 01:41:10 +0000
commit4e32eb8ebedaece6bcd567a20eed14229211dd5d (patch)
tree158f7b67c3a3d748aa2f885ffab394b529f1053c /russian/rux
parentUpgrade to 2.2.2. (diff)
- Fix unicode handling
PR: 134790 Submitted by: Vyacheslav Anikin <anikinsl@gmail.com> (maintainer)
Notes
Notes: svn path=/head/; revision=234368
Diffstat (limited to 'russian/rux')
-rw-r--r--russian/rux/Makefile1
-rw-r--r--russian/rux/files/patch-rux.c37
2 files changed, 38 insertions, 0 deletions
diff --git a/russian/rux/Makefile b/russian/rux/Makefile
index e9cc4984bc37..1b524b2c736b 100644
--- a/russian/rux/Makefile
+++ b/russian/rux/Makefile
@@ -7,6 +7,7 @@
PORTNAME= rux
PORTVERSION= 0.79
+PORTREVISION= 1
CATEGORIES= russian
MASTER_SITES= SF
diff --git a/russian/rux/files/patch-rux.c b/russian/rux/files/patch-rux.c
new file mode 100644
index 000000000000..de062355712d
--- /dev/null
+++ b/russian/rux/files/patch-rux.c
@@ -0,0 +1,37 @@
+--- rux.c.orig 2009-05-21 20:46:40.000000000 +0400
++++ rux.c 2009-05-22 01:11:14.000000000 +0400
+@@ -436,9 +436,16 @@
+
+ #ifndef DEBUG
+ if (strcmp(i_cp->cp_name, "utf-8") == 0) {
++ char hook[4];
++ hook[0] = o_cp->cp_data[6];
++ hook[1] = o_cp->cp_data[34];
++ hook[2] = o_cp->cp_data[18];
++ hook[3] = o_cp->cp_data[39];
++
+ while ((c = getc(in)) != EOF) {
+ if (c == (u_char)0xd0 || c == (u_char)0xd1) {
+- ;
++ conv_tab[0x91] = c == 0xd1 ? hook[0] : hook[1];
++ conv_tab[0x81] = c == 0xd1 ? hook[2] : hook[3];
+ } else {
+ putc(conv_tab[(u_char) c], out);
+ }
+@@ -484,8 +491,16 @@
+ recode_buf(u_char *conv_tab, u_char *buf, int len, FILE *out)
+ {
+ if (strcmp(i_cp->cp_name, "utf-8") == 0) {
++ char hook[4];
++ hook[0] = o_cp->cp_data[6];
++ hook[1] = o_cp->cp_data[34];
++ hook[2] = o_cp->cp_data[18];
++ hook[3] = o_cp->cp_data[39];
++
+ while (len--) {
+ if (*buf == (u_char)0xd0 || *buf == (u_char)0xd1) {
++ conv_tab[0x91] = *buf == 0xd1 ? hook[0] : hook[1];
++ conv_tab[0x81] = *buf == 0xd1 ? hook[2] : hook[3];
+ ++buf;
+ } else {
+ putc(conv_tab[*buf++], out);