r23750 - gnucash/trunk/src/bin - Prevent crashing due to unsupported locale settings
John Ralls
jralls at code.gnucash.org
Thu Jan 23 17:16:40 EST 2014
Author: jralls
Date: 2014-01-23 17:16:40 -0500 (Thu, 23 Jan 2014)
New Revision: 23750
Trac: http://svn.gnucash.org/trac/changeset/23750
Modified:
gnucash/trunk/src/bin/gnucash-bin.c
Log:
Prevent crashing due to unsupported locale settings
Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c 2014-01-23 21:29:28 UTC (rev 23749)
+++ gnucash/trunk/src/bin/gnucash-bin.c 2014-01-23 22:16:40 UTC (rev 23750)
@@ -712,6 +712,15 @@
set_mac_locale();
#endif
gnc_environment_setup();
+#ifndef MAC_INTEGRATION /* setlocale already done */
+ if (!setlocale (LC_ALL, ""))
+ {
+ g_print ("The locale defined in the environment isn't supported. "
+ "Falling back to the 'C' (US English) locale\n");
+ g_setenv ("LC_ALL", "C", TRUE);
+ setlocale (LC_ALL, "C");
+ }
+#endif
#ifdef HAVE_GETTEXT
{
gchar *localedir = gnc_path_get_localedir();
More information about the gnucash-changes
mailing list