-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
const char *revision;
struct loaded_l10nfile *locale_file;
- if ((*name)[0] == '\0'
- /* In SUID binaries we must not allow people to access files
- outside the dedicated locale directories. */
- || (__libc_enable_secure
- && memchr (*name, '/', _nl_find_language (*name) - *name) != NULL))
+ if ((*name)[0] == '\0')
{
/* The user decides which locale to use by setting environment
variables. */
*name = getenv (_nl_category_names[category]);
if (*name == NULL || (*name)[0] == '\0')
*name = getenv ("LANG");
- if (*name == NULL || (*name)[0] == '\0')
- *name = (char *) _nl_C_name;
}
+ if (*name == NULL || (*name)[0] == '\0'
+ || (__builtin_expect (__libc_enable_secure, 0)
+ && memchr (*name, '/', _nl_find_language (*name) - *name) != NULL))
+ *name = (char *) _nl_C_name;
+
if (strcmp (*name, _nl_C_name) == 0 || strcmp (*name, _nl_POSIX_name) == 0)
{
/* We need not load anything. The needed data is contained in