diff options
author | peter <peter@FreeBSD.org> | 2013-08-08 01:53:27 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2013-08-08 01:53:27 +0000 |
commit | 4f61f84d69eaf07fbd7587d0b731fe972ad79fdd (patch) | |
tree | c828deb2715d0685133cae289a0e086d36ebe7f9 /lib/libc/iconv | |
parent | 72912943141c1310b1bd87f639b993d272ec2e43 (diff) | |
download | FreeBSD-src-4f61f84d69eaf07fbd7587d0b731fe972ad79fdd.zip FreeBSD-src-4f61f84d69eaf07fbd7587d0b731fe972ad79fdd.tar.gz |
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.
Diffstat (limited to 'lib/libc/iconv')
-rw-r--r-- | lib/libc/iconv/citrus_iconv.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libc/iconv/citrus_iconv.c b/lib/libc/iconv/citrus_iconv.c index 31cf7df..e4bd24f 100644 --- a/lib/libc/iconv/citrus_iconv.c +++ b/lib/libc/iconv/citrus_iconv.c @@ -116,7 +116,20 @@ open_shared(struct _citrus_iconv_shared * __restrict * __restrict rci, 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); |