about summary refs log tree commit diff
path: root/catgets/catgets.c
diff options
context:
space:
mode:
Diffstat (limited to 'catgets/catgets.c')
-rw-r--r--catgets/catgets.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/catgets/catgets.c b/catgets/catgets.c
index b8e5bf0750..a9425e4091 100644
--- a/catgets/catgets.c
+++ b/catgets/catgets.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
 
@@ -34,6 +34,7 @@ catopen (const char *cat_name, int flag)
 {
   __nl_catd result;
   const char *env_var;
+  const char *nlspath;
 
   result = (__nl_catd) malloc (sizeof (*result));
   if (result == NULL)
@@ -82,10 +83,9 @@ catopen (const char *cat_name, int flag)
 	  return (nl_catd) -1;
 	}
 
-      if (__secure_getenv ("NLSPATH") != NULL)
-	result->nlspath = __strdup (getenv ("NLSPATH"));
-      else
-	result->nlspath = __strdup (NLSPATH);
+      nlspath = __secure_getenv ("NLSPATH");
+      result->nlspath = __strdup (nlspath != NULL && *nlspath != '\0'
+				  ? nlspath : NLSPATH);
 
       if (result->nlspath == NULL)
 	{