summaryrefslogtreecommitdiff
path: root/usr.bin/locale
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2004-02-02 16:14:02 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2004-02-02 16:14:02 +0000
commitaf30114b09ad71bc098c4ff42df15a5288583bb6 (patch)
treeec13b527258f30c827349065846ee24dcf606f4a /usr.bin/locale
parentb8f6dec4558a0d10af905a7669b98fef4436e8eb (diff)
downloadsrc-test-af30114b09ad71bc098c4ff42df15a5288583bb6.tar.gz
src-test-af30114b09ad71bc098c4ff42df15a5288583bb6.zip
Back out LANG printing changes. POSIX is unclear in this place, but
other systems do that in the old way.
Notes
Notes: svn path=/head/; revision=125329
Diffstat (limited to 'usr.bin/locale')
-rw-r--r--usr.bin/locale/locale.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.bin/locale/locale.c b/usr.bin/locale/locale.c
index 4748c44affa5f..9a1e437e0789b 100644
--- a/usr.bin/locale/locale.c
+++ b/usr.bin/locale/locale.c
@@ -421,19 +421,16 @@ void
showlocale(void)
{
size_t i;
- const char *lang, *vval, *eval, *lcall;
+ const char *lang, *vval, *eval;
- (void)setlocale(LC_ALL, "");
+ setlocale(LC_ALL, "");
- if ((lang = getenv("LANG")) == NULL)
+ lang = getenv("LANG");
+ if (lang == NULL) {
lang = "";
+ }
+ printf("LANG=%s\n", lang);
/* XXX: if LANG is null, then set it to "C" to get implied values? */
- if ((lcall = getenv("LC_ALL")) == NULL)
- lcall = "";
- if (!*lcall || !strcmp(lang, lcall))
- printf("LANG=%s\n", lang);
- else
- printf("LANG=\"%s\"\n", lcall);
for (i = 0; i < NLCINFO; i++) {
vval = setlocale(lcinfo[i].id, NULL);
@@ -454,7 +451,11 @@ showlocale(void)
}
}
- printf("LC_ALL=%s\n", lcall);
+ vval = getenv("LC_ALL");
+ if (vval == NULL) {
+ vval = "";
+ }
+ printf("LC_ALL=%s\n", vval);
}
/*