svn commit: r254080 - head/lib/libc/iconv
Peter Wemm
peter at FreeBSD.org
Thu Aug 8 01:53:28 UTC 2013
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);
More information about the svn-src-head
mailing list