提交 674e28af 编写于 作者: R Rich Felker

fix locale environment variable logic for empty strings

per POSIX (XBD 8.2) LC_*/LANG environment variables set to to the
empty string are supposed to be treated as if they were not set at
all.
上级 871a09c8
......@@ -16,9 +16,9 @@ static const char envvars[][12] = {
int __setlocalecat(locale_t loc, int cat, const char *val)
{
if (!*val) {
(val = getenv("LC_ALL")) ||
(val = getenv(envvars[cat])) ||
(val = getenv("LANG")) ||
(val = getenv("LC_ALL")) && *val ||
(val = getenv(envvars[cat])) && *val ||
(val = getenv("LANG")) && *val ||
(val = "C.UTF-8");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册