projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
871a09c
)
fix locale environment variable logic for empty strings
author
Rich Felker
<dalias@aerifal.cx>
Thu, 24 Jul 2014 07:02:17 +0000
(
03:02
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 24 Jul 2014 07:02:17 +0000
(
03:02
-0400)
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.
src/locale/__setlocalecat.c
patch
|
blob
|
history
diff --git
a/src/locale/__setlocalecat.c
b/src/locale/__setlocalecat.c
index f1e4bf07939d315bef1a9320ecce8c0dc6ad6d1f..a947dbfff8a3388f73cd993e42ec92fa5f538f04 100644
(file)
--- a/
src/locale/__setlocalecat.c
+++ b/
src/locale/__setlocalecat.c
@@
-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");
}