about summary refs log tree commit diff
path: root/intl/textdomain.c
diff options
context:
space:
mode:
Diffstat (limited to 'intl/textdomain.c')
-rw-r--r--intl/textdomain.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/intl/textdomain.c b/intl/textdomain.c
index bad9d166c0..116419dd12 100644
--- a/intl/textdomain.c
+++ b/intl/textdomain.c
@@ -57,6 +57,7 @@ extern const char *_nl_current_default_domain;
    prefix.  So we have to make a difference here.  */
 #ifdef _LIBC
 # define TEXTDOMAIN __textdomain
+# define strdup(str) __strdup (str)
 #else
 # define TEXTDOMAIN textdomain__
 #endif
@@ -85,11 +86,15 @@ TEXTDOMAIN (domainname)
       /* If the following malloc fails `_nl_current_default_domain'
 	 will be NULL.  This value will be returned and so signals we
 	 are out of core.  */
+#if defined _LIBC || defined HAVE_STRDUP
+      _nl_current_default_domain = strdup (domainname);
+#else
       size_t len = strlen (domainname) + 1;
       char *cp = (char *) malloc (len);
       if (cp != NULL)
 	memcpy (cp, domainname, len);
       _nl_current_default_domain = cp;
+#endif
     }
 
   if (old != _nl_default_default_domain)