Mercurial > vim
comparison src/gui_x11.c @ 13925:eb264a775071 v8.0.1833
patch 8.0.1833: X11: ":echo 3.14" gives E806
commit https://github.com/vim/vim/commit/889fe2c2b9ba5c92b7e862a4aafbd863585fd633
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 13 16:23:40 2018 +0200
patch 8.0.1833: X11: ":echo 3.14" gives E806
Problem: X11: ":echo 3.14" gives E806.
Solution: set LC_NUMERIC to "C". (Dominique Pelle, closes https://github.com/vim/vim/issues/2368)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 May 2018 16:30:06 +0200 |
parents | 245c053021d3 |
children | 27b9a84395b5 |
comparison
equal
deleted
inserted
replaced
13924:31e8a593e29d | 13925:eb264a775071 |
---|---|
1280 if (app_context != NULL) | 1280 if (app_context != NULL) |
1281 gui.dpy = XtOpenDisplay(app_context, 0, VIM_NAME, VIM_CLASS, | 1281 gui.dpy = XtOpenDisplay(app_context, 0, VIM_NAME, VIM_CLASS, |
1282 cmdline_options, XtNumber(cmdline_options), | 1282 cmdline_options, XtNumber(cmdline_options), |
1283 CARDINAL &gui_argc, gui_argv); | 1283 CARDINAL &gui_argc, gui_argv); |
1284 | 1284 |
1285 # if defined(FEAT_FLOAT) && defined(LC_NUMERIC) | |
1286 { | |
1287 /* The call to XtOpenDisplay() may have set the locale from the | |
1288 * environment. Set LC_NUMERIC to "C" to make sure that strtod() uses a | |
1289 * decimal point, not a comma. */ | |
1290 char *p = setlocale(LC_NUMERIC, NULL); | |
1291 | |
1292 if (p == NULL || strcmp(p, "C") != 0) | |
1293 setlocale(LC_NUMERIC, "C"); | |
1294 } | |
1295 # endif | |
1285 if (app_context == NULL || gui.dpy == NULL) | 1296 if (app_context == NULL || gui.dpy == NULL) |
1286 { | 1297 { |
1287 gui.dying = TRUE; | 1298 gui.dying = TRUE; |
1288 EMSG(_(e_opendisp)); | 1299 EMSG(_(e_opendisp)); |
1289 return FAIL; | 1300 return FAIL; |