rktio: avoid nl_langinfo_l

Using `nl_langinfo_l` crashes the "unicode.rktl" test on Linux. I
don't know how `nl_langinfo_l` was being misused, but it's easy to
just avoid it.
This commit is contained in:
Matthew Flatt 2020-10-19 09:50:16 -06:00
parent a86cf525ef
commit 6c6cfd39b2

View File

@ -356,10 +356,12 @@ static char *nl_langinfo_dup(rktio_t *rktio)
{
char *s;
# if HAVE_CODESET
# ifdef RKTIO_USE_XLOCALE
s = nl_langinfo_l(CODESET, rktio->locale);
# else
# if defined(RKTIO_USE_XLOCALE)
locale_t old_l = uselocale(rktio->locale);
# endif
s = nl_langinfo(CODESET);
# if defined(RKTIO_USE_XLOCALE)
uselocale(old_l);
# endif
# else
/* nl_langinfo doesn't work, so just make up something */