]>
Commit | Line | Data |
---|---|---|
29555daf AM |
1 | From 63f4b9f18f3674124d8bcb119739fec85e6da005 Mon Sep 17 00:00:00 2001 |
2 | From: Timo Teräs <timo.teras@iki.fi> | |
3 | Date: Fri, 05 Jun 2015 07:39:42 +0000 | |
4 | Subject: fix uselocale((locale_t)0) not to modify locale | |
5 | ||
6 | commit 68630b55c0c7219fe9df70dc28ffbf9efc8021d8 made the new locale to | |
7 | be assigned unconditonally resulting in crashes later on. | |
8 | --- | |
9 | diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c | |
10 | index b70a0c1..0fc5ecb 100644 | |
11 | --- a/src/locale/uselocale.c | |
12 | +++ b/src/locale/uselocale.c | |
13 | @@ -8,9 +8,7 @@ locale_t __uselocale(locale_t new) | |
14 | locale_t old = self->locale; | |
15 | locale_t global = &libc.global_locale; | |
16 | ||
17 | - if (new == LC_GLOBAL_LOCALE) new = global; | |
18 | - | |
19 | - self->locale = new; | |
20 | + if (new) self->locale = new == LC_GLOBAL_LOCALE ? global : new; | |
21 | ||
22 | return old == global ? LC_GLOBAL_LOCALE : old; | |
23 | } | |
24 | -- | |
25 | cgit v0.9.0.3-65-g4555 |