]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Don't add //TRANSLIT to an encoding name that already has it.
authorBruno Haible <bruno@clisp.org>
Tue, 30 Apr 2002 16:14:14 +0000 (16:14 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:07:55 +0000 (12:07 +0200)
intl/ChangeLog
intl/loadmsgcat.c

index 80cefa3b3404b7c61727fbba93f7d263fe914abc..8839e5f225bb6aad61898545d11278e81ed34949 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-30  Bruno Haible  <bruno@clisp.org>
+
+       * loadmsgcat.c (_nl_init_domain_conv): Don't append //TRANSLIT to
+       the encoding if it already has slashes.
+       Reported by Perry Rapp <prapp@erols.com>.
+
 2002-04-27  Bruno Haible  <bruno@clisp.org>
 
        * libgnuintl.h: Redirect every function to the one prefixed with
index 76130ed27843ffa4dfcd726eb72587d3d06c276d..c01451b2390a6a3a782b9caceaef32a25f7d09dd 100644 (file)
@@ -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