mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix uselocale((locale_t)0) not to modify locale
commit 68630b55c0
made the new locale to
be assigned unconditonally resulting in crashes later on.
This commit is contained in:
parent
e6f09004af
commit
63f4b9f18f
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue