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:
e6f0900
)
fix uselocale((locale_t)0) not to modify locale
author
Timo Teräs
<timo.teras@iki.fi>
Fri, 5 Jun 2015 07:39:42 +0000
(10:39 +0300)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 5 Jun 2015 15:21:40 +0000
(15:21 +0000)
commit
68630b55c0c7219fe9df70dc28ffbf9efc8021d8
made the new locale to
be assigned unconditonally resulting in crashes later on.
src/locale/uselocale.c
patch
|
blob
|
history
diff --git
a/src/locale/uselocale.c
b/src/locale/uselocale.c
index b70a0c185fb616a85b566e5ca82c5c6bf8c44207..0fc5ecbc07f29437e1afb66815074360bfd360cb 100644
(file)
--- a/
src/locale/uselocale.c
+++ b/
src/locale/uselocale.c
@@
-8,9
+8,7
@@
locale_t __uselocale(locale_t new)
locale_t old = self->locale;
locale_t global = &libc.global_locale;
- if (new == LC_GLOBAL_LOCALE) new = global;
-
- self->locale = new;
+ if (new) self->locale = new == LC_GLOBAL_LOCALE ? global : new;
return old == global ? LC_GLOBAL_LOCALE : old;
}