diff options
author | ache <ache@FreeBSD.org> | 2004-02-02 16:14:02 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2004-02-02 16:14:02 +0000 |
commit | a9340686f1096a3f0b29ccfb1dc65fa2bdef82bb (patch) | |
tree | ec13b527258f30c827349065846ee24dcf606f4a /usr.bin/locale/locale.c | |
parent | 88dbe90498e47d242230cd92bbdff35bf906e5c1 (diff) | |
download | FreeBSD-src-a9340686f1096a3f0b29ccfb1dc65fa2bdef82bb.zip FreeBSD-src-a9340686f1096a3f0b29ccfb1dc65fa2bdef82bb.tar.gz |
Back out LANG printing changes. POSIX is unclear in this place, but
other systems do that in the old way.
Diffstat (limited to 'usr.bin/locale/locale.c')
-rw-r--r-- | usr.bin/locale/locale.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.bin/locale/locale.c b/usr.bin/locale/locale.c index 4748c44..9a1e437 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); } /* |