From owner-svn-src-head@FreeBSD.ORG Thu Aug 8 01:53:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 60584364; Thu, 8 Aug 2013 01:53:28 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DBB72ACD; Thu, 8 Aug 2013 01:53:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r781rSSm010992; Thu, 8 Aug 2013 01:53:28 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r781rSDa010991; Thu, 8 Aug 2013 01:53:28 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201308080153.r781rSDa010991@svn.freebsd.org> From: Peter Wemm Date: Thu, 8 Aug 2013 01:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254080 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2013 01:53:28 -0000 Author: peter Date: Thu Aug 8 01:53:27 2013 New Revision: 254080 URL: http://svnweb.freebsd.org/changeset/base/254080 Log: Our libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a bypass mode when src == dst. Unfortunately, there are tools in ports that pass byte streams through iconv to determine if the encodings are valid. eg: gettext-0.18.3+. Disable the optimization and behave like the other implementations. Modified: head/lib/libc/iconv/citrus_iconv.c Modified: head/lib/libc/iconv/citrus_iconv.c ============================================================================== --- head/lib/libc/iconv/citrus_iconv.c Thu Aug 8 00:06:25 2013 (r254079) +++ head/lib/libc/iconv/citrus_iconv.c Thu Aug 8 01:53:27 2013 (r254080) @@ -116,7 +116,20 @@ open_shared(struct _citrus_iconv_shared size_t len_convname; int ret; +#ifdef INCOMPATIBLE_WITH_GNU_ICONV + /* + * Sadly, the gnu tools expect iconv to actually parse the + * byte stream and don't allow for a pass-through when + * the (src,dest) encodings are the same. + * See gettext-0.18.3+ NEWS: + * msgfmt now checks PO file headers more strictly with less + * false-positives. + * NetBSD don't do this either. + */ module = (strcmp(src, dst) != 0) ? "iconv_std" : "iconv_none"; +#else + module = "iconv_std"; +#endif /* initialize iconv handle */ len_convname = strlen(convname);