From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Dec 20 00:50:00 2012 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A23AB121 for ; Thu, 20 Dec 2012 00:50:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 74E3D8FC15 for ; Thu, 20 Dec 2012 00:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qBK0o053022230 for ; Thu, 20 Dec 2012 00:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qBK0o0sr022229; Thu, 20 Dec 2012 00:50:00 GMT (envelope-from gnats) Resent-Date: Thu, 20 Dec 2012 00:50:00 GMT Resent-Message-Id: <201212200050.qBK0o0sr022229@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, Phil Phillips Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A80F9106 for ; Thu, 20 Dec 2012 00:47:54 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC768FC0C for ; Thu, 20 Dec 2012 00:47:54 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qBK0lsin054369 for ; Thu, 20 Dec 2012 00:47:54 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qBK0lsfP054368; Thu, 20 Dec 2012 00:47:54 GMT (envelope-from nobody) Message-Id: <201212200047.qBK0lsfP054368@red.freebsd.org> Date: Thu, 20 Dec 2012 00:47:54 GMT From: Phil Phillips To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/174583: devel/libreadline-java: patch for UTF8 support X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2012 00:50:00 -0000 >Number: 174583 >Category: ports >Synopsis: devel/libreadline-java: patch for UTF8 support >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 20 00:50:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Phil Phillips >Release: >Organization: Experts Exchange, LLC >Environment: >Description: Here's a patch that effectively removes UTF8<->UCS conversions within the libreadline library. The conversions weren't working for three-byte UTF8. Plus, the conversions are no longer needed since all JDKs supported by FreeBSD should be using UTF16 internally (older JDKs used UCS-2). >How-To-Repeat: >Fix: Patch attached with submission follows: Index: Makefile =================================================================== --- Makefile (revision 309274) +++ Makefile (working copy) @@ -8,7 +8,7 @@ PORTNAME= libreadline-java PORTVERSION= 0.8.0 DISTVERSIONSUFFIX= -src -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel java MASTER_SITES= SF/java-readline/java-readline/${PORTVERSION} Index: files/patch-src-native-org_gnu_readline_Readline.c =================================================================== --- files/patch-src-native-org_gnu_readline_Readline.c (revision 309274) +++ files/patch-src-native-org_gnu_readline_Readline.c (working copy) @@ -1,9 +1,10 @@ ---- src/native/org_gnu_readline_Readline.c.orig 2003-01-07 11:14:35.000000000 +0100 -+++ src/native/org_gnu_readline_Readline.c 2007-09-27 09:21:14.000000000 +0200 -@@ -560,6 +560,21 @@ +--- src/native/org_gnu_readline_Readline.c.orig 2003-01-07 02:14:35.000000000 -0800 ++++ src/native/org_gnu_readline_Readline.c 2012-12-19 10:03:12.000000000 -0800 +@@ -560,14 +560,25 @@ #endif /* -------------------------------------------------------------------------- */ +-/* Convert utf8-string to ucs1-string . */ +/* Sets/gets rl_completion_append_character */ +/* -------------------------------------------------------------------------- */ + @@ -19,6 +20,79 @@ +#endif + +/* -------------------------------------------------------------------------- */ - /* Convert utf8-string to ucs1-string . */ ++/* Hack: Conversion not needed (java running UTF16) */ /* -------------------------------------------------------------------------- */ + char* utf2ucs(const char *utf8) { +- const char *pin; +- char *pout, *ucs; +- unsigned char current, next; +- int i; + size_t n; + + n = strlen(utf8); +@@ -575,36 +586,14 @@ + if (allocBuffer(2*n)) + return NULL; + } +- +- for (i=0,pin=utf8,pout=buffer; i= 0xE0) { /* we support only two-byte utf8 */ +- return NULL; +- } else if ((current & 0x80) == 0) /* one-byte utf8 */ +- *pout = current; +- else { /* two-byte utf8 */ +- next = *(++pin); +- if (next >= 0xC0) { /* illegal coding */ +- return NULL; +- } +- *pout = ((current & 3) << 6) + /* first two bits of first byte */ +- (next & 63); /* last six bits of second byte */ +- } +- } +- if (i>6); /* first two bits */ +- pout++, i++; /* examine second byte */ +- if (i>=bufLength) { /* cannot convert last byte */ +- *(--pout) = '\0'; +- return buffer; +- } +- *pout = 0x80 + (current & 63); /* last six bits */ +- } +- } +- if (iRelease-Note: >Audit-Trail: >Unformatted: