changeset 22379:e1e24b1dba6e v8.2.1738

patch 8.2.1738: Mac: str2float() recognizes comma instead of decimal point Commit: https://github.com/vim/vim/commit/509f8031b2b347c033327ef33f3e5573a0595dbc Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 24 23:08:19 2020 +0200 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 https://github.com/vim/vim/issues/7003)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Sep 2020 23:15:04 +0200
parents 61c93dd752ad
children 4b2dec9c0c29
files src/os_mac_conv.c src/version.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_mac_conv.c
+++ b/src/os_mac_conv.c
@@ -580,6 +580,10 @@ mac_lang_init(void)
 #   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
 	}
     }
 }
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1738,
+/**/
     1737,
 /**/
     1736,