Skip to content

Commit

Permalink
patch 8.0.1833: X11: ":echo 3.14" gives E806
Browse files Browse the repository at this point in the history
Problem:    X11: ":echo 3.14" gives E806.
Solution:   set LC_NUMERIC to "C". (Dominique Pelle, closes #2368)
  • Loading branch information
brammool committed May 13, 2018
1 parent 137374f commit 889fe2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui_x11.c
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1833,
/**/
1832,
/**/
Expand Down

0 comments on commit 889fe2c

Please sign in to comment.