summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-04-29 15:11:43 +0200
committerBram Moolenaar <Bram@vim.org>2014-04-29 15:11:43 +0200
commit1ff32c5c2cec3597a5695ca79825ab53441dbf06 (patch)
tree454e27e28ee19ebb3c4748fe61dc133c602ea9e0 /src/gui_gtk_x11.c
parent3d1956bcc9b2f606a8b6b03b3852a6eed9847348 (diff)
updated for version 7.4.270v7.4.270
Problem: Comparing pointers instead of the string they point to. Solution: Use strcmp(). (Ken Takata)
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 1cb47b44b0..3e1616c853 100644
--- 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