Mercurial > vim
diff src/gui_gtk_x11.c @ 5854:c519c446c548 v7.4.270
updated for version 7.4.270
Problem: Comparing pointers instead of the string they point to.
Solution: Use strcmp(). (Ken Takata)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 29 Apr 2014 15:11:43 +0200 |
parents | a43a8262e1ce |
children | 662ae48e7e24 |
line wrap: on
line diff
--- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -3142,10 +3142,14 @@ gui_mch_init(void) gnome_program_init(VIMPACKAGE, VIM_VERSION_SHORT, LIBGNOMEUI_MODULE, gui_argc, gui_argv, NULL); # if defined(FEAT_FLOAT) && defined(LC_NUMERIC) - /* Make sure strtod() uses a decimal point, not a comma. Gnome init - * may change it. */ - if (setlocale(LC_NUMERIC, NULL) != (char *) "C") - setlocale(LC_NUMERIC, "C"); + { + char *p = setlocale(LC_NUMERIC, NULL); + + /* Make sure strtod() uses a decimal point, not a comma. Gnome + * init may change it. */ + if (p == NULL || strcmp(p, "C") != 0) + setlocale(LC_NUMERIC, "C"); + } # endif } #endif