From: Bruno Haible Date: Sat, 30 Sep 2023 12:52:20 +0000 (+0200) Subject: intl: Merge from glibc. X-Git-Tag: v0.23~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afd77c3e99fe290bd9b2d82c09ac864b836b0ac9;p=thirdparty%2Fgettext.git intl: Merge from glibc. Apply commit 2017-03-13 Wilco Dijkstra Remove the str(n)dup inlines from string/bits/string2.h... --- diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index 64a0dd935..4e0f3a2bd 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -132,6 +132,7 @@ extern int errno; /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ +# define strdup __strdup # define getcwd __getcwd # ifndef stpcpy # define stpcpy __stpcpy diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c index 9aff02d4a..59e7463de 100644 --- a/gettext-runtime/intl/finddomain.c +++ b/gettext-runtime/intl/finddomain.c @@ -140,9 +140,12 @@ _nl_find_domain (const char *dirname, alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { - locale = strdup (alias_value); + size_t len = strlen (alias_value) + 1; + locale = (char *) malloc (len); if (locale == NULL) - return NULL; + return NULL; + + memcpy (locale, alias_value, len); } /* Now we determine the single parts of the locale name. First