From b711cb4f13e3ccb2855f0b53a1a71e3157650b88 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 3 May 1998 20:38:44 +0000 Subject: update from gettext-0.10.35 --- intl/textdomain.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'intl/textdomain.c') diff --git a/intl/textdomain.c b/intl/textdomain.c index 2f077a0..8855746 100644 --- a/intl/textdomain.c +++ b/intl/textdomain.c @@ -1,5 +1,5 @@ -/* Implementation of the textdomain(3) function - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. +/* Implementation of the textdomain(3) function. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify @@ -54,6 +54,9 @@ extern const char *_nl_current_default_domain; prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain +# ifndef strdup +# define strdup(str) __strdup (str) +# endif #else # define TEXTDOMAIN textdomain__ #endif @@ -82,11 +85,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) -- cgit v1.2.3