mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-28 21:41:15 -03:00
Create an immortal C locale
This adds a function fish_c_locale() which returns an immortal locale_t corresponding to the C locale, and switches builtin_printf to use wcstod_l.
This commit is contained in:
@@ -517,6 +517,11 @@ int fish_wcswidth(const wchar_t *str) { return fish_wcswidth(str, wcslen(str));
|
||||
/// See fallback.h for the normal definitions.
|
||||
int fish_wcswidth(const wcstring &str) { return fish_wcswidth(str.c_str(), str.size()); }
|
||||
|
||||
locale_t fish_c_locale() {
|
||||
static locale_t loc = newlocale(LC_ALL_MASK, "C", NULL);
|
||||
return loc;
|
||||
}
|
||||
|
||||
/// Like fish_wcstol(), but fails on a value outside the range of an int.
|
||||
///
|
||||
/// This is needed because BSD and GNU implementations differ in several ways that make it really
|
||||
|
||||
Reference in New Issue
Block a user