about summary refs log tree commit diff
path: root/locale/setlocale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/setlocale.c')
-rw-r--r--locale/setlocale.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/locale/setlocale.c b/locale/setlocale.c
index 76320f8a32..ceec1a69a6 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -227,6 +227,7 @@ setlocale (int category, const char *locale)
 {
   char *locale_path;
   size_t locale_path_len;
+  const char *locpath_var;
   char *composite;
 
   /* Sanity check for CATEGORY argument.  */
@@ -248,15 +249,11 @@ setlocale (int category, const char *locale)
   locale_path = NULL;
   locale_path_len = 0;
 
-  if (!__libc_enable_secure)
-    {
-      char *locpath_var = getenv ("LOCPATH");
-
-      if (locpath_var != NULL && locpath_var[0] != '\0')
-	if (__argz_create_sep (locpath_var, ':',
-			       &locale_path, &locale_path_len) != 0)
-	  return NULL;
-    }
+  locpath_var = __secure_getenv ("LOCPATH");
+  if (locpath_var != NULL && locpath_var[0] != '\0')
+    if (__argz_create_sep (locpath_var, ':',
+			   &locale_path, &locale_path_len) != 0)
+      return NULL;
 
   if (__argz_append (&locale_path, &locale_path_len,
 		     LOCALE_PATH, sizeof (LOCALE_PATH)) != 0)