mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 11:22:52 +08:00
fallback: Set LC_ALL in wcstod_l fallback
Apparently some wcstod's don't care about LC_NUMERIC.
This commit is contained in:
parent
c0dc1870f0
commit
4562f8f4e3
|
@ -395,7 +395,12 @@ int flock(int fd, int op) {
|
|||
// thread-specific locale.
|
||||
double fish_compat::wcstod_l(const wchar_t *enptr, wchar_t **endptr, locale_t loc) {
|
||||
// Create and use a new, thread-specific locale
|
||||
locale_t locale = newlocale(LC_NUMERIC, "C", nullptr);
|
||||
// NOTE: We use "C" whatever the passed locale,
|
||||
// and we use the LC_ALL category.
|
||||
//
|
||||
// Empirically, this fails on OpenIndiana/Illumos/Solaris/SunOS if using LC_NUMERIC.
|
||||
// Since we reset it afterwards, it shouldn't matter.
|
||||
locale_t locale = newlocale(LC_ALL, "C", nullptr);
|
||||
locale_t prev_locale = uselocale(locale);
|
||||
double ret = wcstod(enptr, endptr);
|
||||
// Restore the old locale before freeing the locale we created and are still using
|
||||
|
|
Loading…
Reference in New Issue
Block a user