]> granicus.if.org Git - vim/commitdiff
patch 8.0.1833: X11: ":echo 3.14" gives E806 v8.0.1833
authorBram Moolenaar <Bram@vim.org>
Sun, 13 May 2018 14:23:40 +0000 (16:23 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 May 2018 14:23:40 +0000 (16:23 +0200)
Problem:    X11: ":echo 3.14" gives E806.
Solution:   set LC_NUMERIC to "C". (Dominique Pelle, closes #2368)

src/gui_x11.c
src/version.c

index 490844969bc756d359d368853ea11ba8fde51810..7a5cae03ec6374d8b21e415ab0d7023babafeb00 100644 (file)
@@ -1282,6 +1282,17 @@ gui_mch_init_check(void)
                cmdline_options, XtNumber(cmdline_options),
                CARDINAL &gui_argc, gui_argv);
 
+# if defined(FEAT_FLOAT) && defined(LC_NUMERIC)
+    {
+       /* The call to XtOpenDisplay() may have set the locale from the
+        * environment. Set LC_NUMERIC to "C" to make sure that strtod() uses a
+        * decimal point, not a comma. */
+       char *p = setlocale(LC_NUMERIC, NULL);
+
+       if (p == NULL || strcmp(p, "C") != 0)
+          setlocale(LC_NUMERIC, "C");
+    }
+# endif
     if (app_context == NULL || gui.dpy == NULL)
     {
        gui.dying = TRUE;
index 080ba72e38e981cf589374008818d3354e0bcf47..e19b180acb1865d93b5e07a93a0f519400fb46ac 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1833,
 /**/
     1832,
 /**/