patch 8.2.1738: Mac: str2float() recognizes comma instead of decimal point

Problem:    Mac: str2float() recognizes comma instead of decimal point.
Solution:   Set LC_NUMERIC to "C". (closes #7003)
This commit is contained in:
Bram Moolenaar 2020-09-24 23:08:19 +02:00
parent 10476521f5
commit 509f8031b2
2 changed files with 6 additions and 0 deletions

View File

@ -579,6 +579,10 @@ mac_lang_init(void)
vim_setenv((char_u *)"LANG", (char_u *)buf);
# ifdef HAVE_LOCALE_H
setlocale(LC_ALL, "");
# endif
# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
// Make sure strtod() uses a decimal point, not a comma.
setlocale(LC_NUMERIC, "C");
# endif
}
}

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1738,
/**/
1737,
/**/