if (strcmp (dirname, _nl_default_dirname) == 0)
result = (char *) _nl_default_dirname;
else
- {
-#if defined _LIBC || defined HAVE_STRDUP
- result = strdup (dirname);
-#else
- size_t len = strlen (dirname) + 1;
- result = (char *) malloc (len);
- if (__builtin_expect (result != NULL, 1))
- memcpy (result, dirname, len);
-#endif
- }
+ result = strdup (dirname);
if (__builtin_expect (result != NULL, 1))
{
char *result = binding->codeset;
if (result == NULL || strcmp (codeset, result) != 0)
{
-#if defined _LIBC || defined HAVE_STRDUP
result = strdup (codeset);
-#else
- size_t len = strlen (codeset) + 1;
- result = (char *) malloc (len);
- if (__builtin_expect (result != NULL, 1))
- memcpy (result, codeset, len);
-#endif
-
if (__builtin_expect (result != NULL, 1))
{
free (binding->codeset);
dirname = _nl_default_dirname;
else
{
- char *result;
-#if defined _LIBC || defined HAVE_STRDUP
- result = strdup (dirname);
+ char *result = strdup (dirname);
if (__builtin_expect (result == NULL, 0))
goto failed_dirname;
-#else
- size_t len = strlen (dirname) + 1;
- result = (char *) malloc (len);
- if (__builtin_expect (result == NULL, 0))
- goto failed_dirname;
- memcpy (result, dirname, len);
-#endif
dirname = result;
}
}
if (codeset != NULL)
{
- char *result;
-
-#if defined _LIBC || defined HAVE_STRDUP
- result = strdup (codeset);
+ char *result = strdup (codeset);
if (__builtin_expect (result == NULL, 0))
goto failed_codeset;
-#else
- size_t len = strlen (codeset) + 1;
- result = (char *) malloc (len);
- if (__builtin_expect (result == NULL, 0))
- goto failed_codeset;
- memcpy (result, codeset, len);
-#endif
codeset = result;
}
*codesetp = codeset;
new_domain = old_domain;
else
{
- /* If the following malloc fails `_nl_current_default_domain'
+ /* If the following strdup 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
+ are out of memory. */
new_domain = strdup (domainname);
-#else
- size_t len = strlen (domainname) + 1;
- new_domain = (char *) malloc (len);
- if (new_domain != NULL)
- memcpy (new_domain, domainname, len);
-#endif
-
if (new_domain != NULL)
_nl_current_default_domain = new_domain;
}
-# intl.m4 serial 49 (gettext-0.21.1)
+# intl.m4 serial 50 (gettext-0.21.1)
dnl Copyright (C) 1995-2014, 2016-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_CHECK_HEADERS([inttypes.h unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
- stpcpy strcasecmp strdup strtoul tsearch __fsetlocking])
+ stpcpy strcasecmp strtoul tsearch __fsetlocking])
dnl Use the *_unlocked functions only if they are declared.
dnl (because some of them were defined without being declared in Solaris