mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 19:03:38 +08:00
Revert "builtin_printf: Use proper functions"
This reverts commit 1102b83b2d
.
wcstold_l is not available on musl and we don't currently have our "own" implementation.
Revert for now until we do.
This commit is contained in:
parent
439470b048
commit
83f153eb4c
|
@ -288,13 +288,13 @@ uintmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
long double raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
|
long double raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
|
||||||
auto val = std::wcstold(s, end);
|
double val = std::wcstod(s, end);
|
||||||
if (**end == L'\0') return val;
|
if (**end == L'\0') return val;
|
||||||
// The conversion using the user's locale failed. That may be due to the string not being a
|
// The conversion using the user's locale failed. That may be due to the string not being a
|
||||||
// valid floating point value. It could also be due to the locale using different separator
|
// valid floating point value. It could also be due to the locale using different separator
|
||||||
// characters than the normal english convention. So try again by forcing the use of a locale
|
// characters than the normal english convention. So try again by forcing the use of a locale
|
||||||
// that employs the english convention for writing floating point numbers.
|
// that employs the english convention for writing floating point numbers.
|
||||||
return wcstold_l(s, end, fish_c_locale());
|
return wcstod_l(s, end, fish_c_locale());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user