提交 63f4b9f1 编写于 作者: T Timo Teräs 提交者: Rich Felker

fix uselocale((locale_t)0) not to modify locale

commit 68630b55 made the new locale to
be assigned unconditonally resulting in crashes later on.
上级 e6f09004
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册