Back out LANG printing changes. POSIX is unclear in this place, but
other systems do that in the old way.
This commit is contained in:
parent
b8f6dec455
commit
af30114b09
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user