locale-print-LANGUAGE
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sat, 17 May 2025 15:15:43 +0000 (17:15 +0200)
committerAurelien Jarno <aurel32@debian.org>
Sat, 17 May 2025 15:15:43 +0000 (17:15 +0200)
Comments tell that LANG has to be the first value, and LC_ALL the last
one.  Thus LANGUAGE is printed between them.

# DP: Dpatch author: Denis Barbier
# DP: Patch author: Denis Barbier
# DP: Upstream status: not submitted
# DP: Date: 2006-01-08

Gbp-Pq: Topic locale
Gbp-Pq: Name locale-print-LANGUAGE.diff

locale/programs/locale.c
locale/tst-locale-locpath.sh

index 7e8832dc3b3c27c773e4ce63ce6cde2e1daf5ab9..0feef25f996ab9110df5de68a56bdb80b89cf6d2 100644 (file)
@@ -797,11 +797,15 @@ static void
 show_locale_vars (void)
 {
   const char *lcall = getenv ("LC_ALL") ?: "";
+  const char *language = getenv ("LANGUAGE") ?: "";
   const char *lang = getenv ("LANG") ?: "";
 
   /* 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 (size_t cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
     if (cat_no != LC_ALL)
index 5c5b7610adf71d934d55de1158834bcccb1d81ec..e57440dcf8f51b9076057c4ebdd6062ce1495dc7 100644 (file)
@@ -54,6 +54,7 @@ EOF
 
 cat > "$testroot/stdout-expected" <<EOF
 LANG=
+LANGUAGE=
 LC_CTYPE="invalid-locale"
 LC_NUMERIC="invalid-locale"
 LC_TIME="invalid-locale"