From: Ulrich Drepper Date: Sat, 29 Jan 2000 11:52:12 +0000 (+0000) Subject: (catopen): Handle NL_CAT_LOCALE correctly. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4443d1b2c73c75f7935be8bebb1edee4bb5cb3c2;p=thirdparty%2Fglibc.git (catopen): Handle NL_CAT_LOCALE correctly. --- diff --git a/catgets/catgets.c b/catgets/catgets.c index c6fd13d4b49..86ff0ff831d 100644 --- a/catgets/catgets.c +++ b/catgets/catgets.c @@ -1,4 +1,4 @@ -/* 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, . @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -43,20 +44,15 @@ catopen (const char *cat_name, int flag) if (strchr (cat_name, '/') == NULL) { if (flag == NL_CAT_LOCALE) - { - env_var = getenv ("LC_ALL"); - if (env_var == NULL) - env_var = getenv ("LC_MESSAGES"); - - if (env_var != NULL) - goto have_env_var; - } + /* Use the current locale setting for LC_MESSAGES. */ + env_var = setlocale (LC_MESSAGES, NULL); + else + /* Use the LANG environment variable. */ + env_var = getenv ("LANG"); - env_var = getenv ("LANG"); if (env_var == NULL) env_var = "C"; - have_env_var: env_var_len = strlen (env_var) + 1; nlspath = __secure_getenv ("NLSPATH");