aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-06-05 10:47:34 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-06-05 10:47:34 +0300
commit3a127bb22d1044e5e1a66a4e521f0841f62cdb26 (patch)
treea4c24f1732e5ec87d1832ff55ed54d8c7fc4e04f /main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch
parent585bfa9a7ba9d9e08d53b891bc6514605129ed1b (diff)
downloadaports-3a127bb22d1044e5e1a66a4e521f0841f62cdb26.tar.bz2
aports-3a127bb22d1044e5e1a66a4e521f0841f62cdb26.tar.xz
main/musl: fix locale regression in 1.1.10
Diffstat (limited to 'main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch')
-rw-r--r--main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch b/main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch
new file mode 100644
index 0000000000..2e4370b555
--- /dev/null
+++ b/main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch
@@ -0,0 +1,29 @@
+From bf8130a2843909df0d14cce5b5149cde35f887ac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Fri, 5 Jun 2015 10:39:42 +0300
+Subject: [PATCH] fix uselocale((locale_t)0) to not modify locale
+
+commit 68630b55c0c7 made the new locale to be assigned unconditonally
+resulting in crashes later on.
+---
+ src/locale/uselocale.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c
+index b70a0c1..0fc5ecb 100644
+--- 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;
+ }
+--
+2.4.2
+