From: Bruno Haible Date: Tue, 30 Apr 2002 16:14:14 +0000 (+0000) Subject: Don't add //TRANSLIT to an encoding name that already has it. X-Git-Tag: v0.11.3~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7f7027543a4ce1a3ca89ea63096575227bfe99;p=thirdparty%2Fgettext.git Don't add //TRANSLIT to an encoding name that already has it. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index 80cefa3b3..8839e5f22 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,9 @@ +2002-04-30 Bruno Haible + + * loadmsgcat.c (_nl_init_domain_conv): Don't append //TRANSLIT to + the encoding if it already has slashes. + Reported by Perry Rapp . + 2002-04-27 Bruno Haible * libgnuintl.h: Redirect every function to the one prefixed with diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 76130ed27..c01451b23 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -1,5 +1,5 @@ /* Load needed message catalogs. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -216,19 +216,23 @@ _nl_init_domain_conv (domain_file, domain, domainbinding) we want to use transliteration. */ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ || _LIBICONV_VERSION >= 0x0105 - len = strlen (outcharset); - { - char *tmp = (char *) alloca (len + 10 + 1); - memcpy (tmp, outcharset, len); - memcpy (tmp + len, "//TRANSLIT", 10 + 1); - outcharset = tmp; - } -# endif - domain->conv = iconv_open (outcharset, charset); -# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ - || _LIBICONV_VERSION >= 0x0105 - freea (outcharset); + if (strchr (outcharset, '/') == NULL) + { + char *tmp; + + len = strlen (outcharset); + tmp = (char *) alloca (len + 10 + 1); + memcpy (tmp, outcharset, len); + memcpy (tmp + len, "//TRANSLIT", 10 + 1); + outcharset = tmp; + + domain->conv = iconv_open (outcharset, charset); + + freea (outcharset); + } + else # endif + domain->conv = iconv_open (outcharset, charset); # endif # endif