diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-03-17 03:41:49 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-03-17 03:41:49 +0000 |
commit | ff407b13b9cd6277d6221d1c180866aedb6839cb (patch) | |
tree | 4bf3e8719b3c8ed8bcef15e12b7afcedbcca58a8 /catgets | |
parent | (build-shlib): Also create symlink if library is versioned. (diff) | |
download | glibc-ff407b13b9cd6277d6221d1c180866aedb6839cb.tar.gz glibc-ff407b13b9cd6277d6221d1c180866aedb6839cb.tar.bz2 glibc-ff407b13b9cd6277d6221d1c180866aedb6839cb.zip |
(catopen): Always add NLSPATH to search path for catalogs, not only if
the envvar NLSPATH is not available.
Diffstat (limited to 'catgets')
-rw-r--r-- | catgets/catgets.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/catgets/catgets.c b/catgets/catgets.c index b8e5bf0750..9228f970d6 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,8 +83,16 @@ catopen (const char *cat_name, int flag) return (nl_catd) -1; } - if (__secure_getenv ("NLSPATH") != NULL) - result->nlspath = __strdup (getenv ("NLSPATH")); + nlspath = __secure_getenv ("NLSPATH"); + if (nlspath != NULL && *nlspath != '\0') + { + /* Append the system dependent directory. */ + size_t len = strlen (nlspath + 1 + sizeof NLSPATH); + char *tmp = alloca (len); + + __stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH); + nlspath = tmp; + } else result->nlspath = __strdup (NLSPATH); |