From owner-freebsd-ports-bugs@FreeBSD.ORG Thu May 21 17:50:06 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50731065673 for ; Thu, 21 May 2009 17:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F09C8FC21 for ; Thu, 21 May 2009 17:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4LHo6Q3001086 for ; Thu, 21 May 2009 17:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4LHo6e9001076; Thu, 21 May 2009 17:50:06 GMT (envelope-from gnats) Resent-Date: Thu, 21 May 2009 17:50:06 GMT Resent-Message-Id: <200905211750.n4LHo6e9001076@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vyacheslav Anikin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85FB2106566C for ; Thu, 21 May 2009 17:46:26 +0000 (UTC) (envelope-from anikinsl@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 141F68FC18 for ; Thu, 21 May 2009 17:46:25 +0000 (UTC) (envelope-from anikinsl@gmail.com) Received: by fg-out-1718.google.com with SMTP id e12so1230266fga.12 for ; Thu, 21 May 2009 10:46:25 -0700 (PDT) Received: by 10.86.70.20 with SMTP id s20mr2404640fga.1.1242926346475; Thu, 21 May 2009 10:19:06 -0700 (PDT) Received: from localhost ([83.167.112.58]) by mx.google.com with ESMTPS id l12sm1366546fgb.6.2009.05.21.10.19.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 May 2009 10:19:01 -0700 (PDT) Message-Id: <20090521171859.GA28355@cia.no> Date: Thu, 21 May 2009 21:19:00 +0400 From: Vyacheslav Anikin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/134791: [maintainer update] russian/rux: fixes to utf-8 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Vyacheslav Anikin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 17:50:07 -0000 >Number: 134791 >Category: ports >Synopsis: [maintainer update] russian/rux: fixes to utf-8 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Thu May 21 17:50:06 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Vyacheslav Anikin >Release: FreeBSD 7.1-RELEASE-p5 i386 >Organization: >Environment: System: FreeBSD cia.no 7.1-RELEASE-p5 FreeBSD 7.1-RELEASE-p5 #0: Sun Apr 26 01:23:07 MSD 2009 root@example.com:/usr/obj/usr/src/sys/ix i386 >Description: Due to second bytes is equals in utf-8 sequences 0xd091 and 0xd191, this port application outputs cyrillic 'yo' instead cyrillic 'B'. >How-To-Repeat: >Fix: --- rux.c.orig 2009-05-21 20:46:40.000000000 +0400 +++ rux.c 2009-05-21 20:50:26.000000000 +0400 @@ -436,9 +436,13 @@ #ifndef DEBUG if (strcmp(i_cp->cp_name, "utf-8") == 0) { + char hook[2]; + hook[0] = o_cp->cp_data[6]; + hook[1] = o_cp->cp_data[34]; + while ((c = getc(in)) != EOF) { if (c == (u_char)0xd0 || c == (u_char)0xd1) { - ; + conv_tab[0x91] = c == 0xd1 ? hook[0] : hook[1]; } else { putc(conv_tab[(u_char) c], out); } @@ -484,8 +488,13 @@ recode_buf(u_char *conv_tab, u_char *buf, int len, FILE *out) { if (strcmp(i_cp->cp_name, "utf-8") == 0) { + char hook[2]; + hook[0] = o_cp->cp_data[6]; + hook[1] = o_cp->cp_data[34]; + while (len--) { if (*buf == (u_char)0xd0 || *buf == (u_char)0xd1) { + conv_tab[0x91] = *buf == 0xd1 ? hook[0] : hook[1]; ++buf; } else { putc(conv_tab[*buf++], out); >Release-Note: >Audit-Trail: >Unformatted: