about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-04-29 02:53:27 +0000
committerUlrich Drepper <drepper@redhat.com>2002-04-29 02:53:27 +0000
commitbc3bb89c0a7c124d7320f143e52b353cdde645f5 (patch)
tree1b60188f69300fa37138976c834f1481dd37eaa3
parenta5d07eb215256f78193e3ae865d0b462bac775f6 (diff)
downloadglibc-bc3bb89c0a7c124d7320f143e52b353cdde645f5.tar.gz
glibc-bc3bb89c0a7c124d7320f143e52b353cdde645f5.tar.xz
glibc-bc3bb89c0a7c124d7320f143e52b353cdde645f5.zip
Update.
2002-04-28  Ulrich Drepper  <drepper@redhat.com>

	* intl/loadmsgcat.c [!_LIBC] (_nl_init_domain_conv): Don't add
	//TRANSLIT twice.
-rw-r--r--ChangeLog5
-rw-r--r--intl/loadmsgcat.c15
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index efd5a823b3..f3e302abcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-28  Ulrich Drepper  <drepper@redhat.com>
+
+	* intl/loadmsgcat.c [!_LIBC] (_nl_init_domain_conv): Don't add
+	//TRANSLIT twice.
+
 2002-04-27  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/ia64/fxstat.c: Fix a few issues with the
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index 41f56500b8..db6e7ea6d6 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, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -201,12 +201,13 @@ _nl_init_domain_conv (domain_file, domain, domainbinding)
 #   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;
-	  }
+	  if (len < 10 || strcmp (outcharset + len - 9, "/TRANSLIT") != 0)
+	    {
+	      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 \