[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 5/7] locale: also display the LANGUAGE environment variable when invoked without arguments



From: Denis Barbier <bouzim@gmail.com>
Date: Sun, 6 Feb 2011 14:15:18 -0600

Comments tell that LANG has to be the first value, and LC_ALL the last
one.  Thus LANGUAGE is printed between them.

Original patch from belocs-locales-bin 2.3.4-2, 2005-03-19.

[bouzim@gmail.com, 2005-12-31: disable if POSIXLY_CORRECT is set]
[aurelien@aurel32.net, 2011-02-06: do not suppress LANGUAGE= line
 when LANGUAGE is unset]

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 locale/programs/locale.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index bf820ca..6d48e0d 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -793,6 +793,7 @@ show_locale_vars (void)
 {
   size_t cat_no;
   const char *lcall = getenv ("LC_ALL") ? : "";
+  const char *language = getenv ("LANGUAGE") ? : "";
   const char *lang = getenv ("LANG") ? : "";
 
   auto void get_source (const char *name);
@@ -811,6 +812,9 @@ show_locale_vars (void)
   /* LANG has to be the first value.  */
   print_assignment ("LANG", lang, false);
 
+  if (getenv ("POSIXLY_CORRECT") == NULL)
+    printf ("LANGUAGE=%s\n", language);
+
   /* Now all categories in an unspecified order.  */
   for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
     if (cat_no != LC_ALL)
-- 
1.7.5.1


Reply to: