math: Use fish_wcstod instead

1. This should be using our wcstod_l on platforms where we need
it (for some reason it wasn't picking it up on FreeBSD?)

2. This purports to have a "fast path". I like fast paths.
This commit is contained in:
Fabian Homborg
2020-12-14 23:09:01 +01:00
parent 3af07e6c6e
commit 0f5a226e2f

View File

@@ -251,7 +251,7 @@ static void next_token(state *s) {
/* Try reading a number. */
if ((s->next[0] >= '0' && s->next[0] <= '9') || s->next[0] == '.') {
s->value = wcstod_l(s->next, const_cast<wchar_t **>(&s->next), fish_c_locale());
s->value = fish_wcstod(s->next, const_cast<wchar_t **>(&s->next));
s->type = TOK_NUMBER;
} else {
/* Look for a function call. */