]> granicus.if.org Git - vim/commitdiff
patch 8.2.1738: Mac: str2float() recognizes comma instead of decimal point v8.2.1738
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Sep 2020 21:08:19 +0000 (23:08 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Sep 2020 21:08:19 +0000 (23:08 +0200)
Problem:    Mac: str2float() recognizes comma instead of decimal point.
Solution:   Set LC_NUMERIC to "C". (closes #7003)

src/os_mac_conv.c
src/version.c

index 3daf74a48ae3110b88ed882483d5eae6fc325666..fd62124644c7b5601b539f0432c25abff0cf8c24 100644 (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
        }
     }
index 24e30ff1d64f4a6b0321ab26faafa931a44827ba..0b3c5f559d598e7736f761137658c86be68f88a3 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1738,
 /**/
     1737,
 /**/