]> git.pld-linux.org Git - packages/musl.git/blame - musl-locale.patch
- and one more upstream fix
[packages/musl.git] / musl-locale.patch
CommitLineData
29555daf
AM
1From 63f4b9f18f3674124d8bcb119739fec85e6da005 Mon Sep 17 00:00:00 2001
2From: Timo Teräs <timo.teras@iki.fi>
3Date: Fri, 05 Jun 2015 07:39:42 +0000
4Subject: fix uselocale((locale_t)0) not to modify locale
5
6commit 68630b55c0c7219fe9df70dc28ffbf9efc8021d8 made the new locale to
7be assigned unconditonally resulting in crashes later on.
8---
9diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c
10index 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--
25cgit v0.9.0.3-65-g4555
This page took 0.093539 seconds and 4 git commands to generate.