#include <string.h>
-#if defined _LIBC || defined HAVE_ARGZ_H
+#if defined _LIBC
# include <argz.h>
#endif
#include <ctype.h>
# include "filename.h"
#endif
-/* Define function which are usually not available. */
-
-#if defined HAVE_ARGZ_COUNT
-# undef __argz_count
-# define __argz_count argz_count
-#else
-/* Returns the number of strings in ARGZ. */
-static size_t
-argz_count__ (const char *argz, size_t len)
-{
- size_t count = 0;
- while (len > 0)
- {
- size_t part_len = strlen (argz);
- argz += part_len + 1;
- len -= part_len + 1;
- count++;
- }
- return count;
-}
-# undef __argz_count
-# define __argz_count(argz, len) argz_count__ (argz, len)
-#endif /* !_LIBC && !HAVE_ARGZ_COUNT */
-
-#if defined HAVE_ARGZ_STRINGIFY
-# undef __argz_stringify
-# define __argz_stringify argz_stringify
-#else
-/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
- except the last into the character SEP. */
-static void
-argz_stringify__ (char *argz, size_t len, int sep)
-{
- while (len > 0)
- {
- size_t part_len = strlen (argz);
- argz += part_len;
- len -= part_len + 1;
- if (len > 0)
- *argz++ = sep;
- }
-}
-# undef __argz_stringify
-# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
-#endif /* !_LIBC && !HAVE_ARGZ_STRINGIFY */
-
-#ifdef _LIBC
-#elif defined HAVE_ARGZ_NEXT
-# undef __argz_next
-# define __argz_next argz_next
-#else
-static char *
-argz_next__ (char *argz, size_t argz_len, const char *entry)
-{
- if (entry)
- {
- if (entry < argz + argz_len)
- entry = strchr (entry, '\0') + 1;
-
- return entry >= argz + argz_len ? NULL : (char *) entry;
- }
- else
- if (argz_len > 0)
- return argz;
- else
- return 0;
-}
-# undef __argz_next
-# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
-#endif /* !_LIBC && !HAVE_ARGZ_NEXT */
-
/* Return number of bits set in X. */
#ifndef ARCH_POP
static inline int
if (dirlist_len > 0)
{
memcpy (cp, dirlist, dirlist_len);
+#ifdef _LIBC
__argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
+#endif
cp += dirlist_len;
cp[-1] = '/';
}
return retval;
}
+#ifdef _LIBC
dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
+#else
+ dirlist_count = 1;
+#endif
/* Allocate a new loaded_l10nfile. */
retval =
if ((cnt & ~mask) == 0
&& !((cnt & XPG_CODESET) != 0 && (cnt & XPG_NORM_CODESET) != 0))
{
+#ifdef _LIBC
if (dirlist_count > 1)
{
/* Iterate over all elements of the DIRLIST. */
1);
}
else
+#endif
retval->successor[entries++]
= _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
cnt, language, territory, codeset,
-# intl.m4 serial 39 (gettext-0.20.2)
+# intl.m4 serial 40 (gettext-0.20.2)
dnl Copyright (C) 1995-2014, 2016-2020 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_DEFINE([HAVE_BUILTIN_EXPECT], [1],
[Define to 1 if the compiler understands __builtin_expect.])])
- AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
+ AC_CHECK_HEADERS([inttypes.h limits.h unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
- stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
- argz_next __fsetlocking])
+ stpcpy strcasecmp strdup 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