AUDIT: r22293 - gnucash/trunk/src/bin - [Bug 680613] Date format setting seems to be ignored since version 2.4.9

John Ralls jralls at code.gnucash.org
Wed Aug 8 01:38:35 EDT 2012


Author: jralls
Date: 2012-08-08 01:38:34 -0400 (Wed, 08 Aug 2012)
New Revision: 22293
Trac: http://svn.gnucash.org/trac/changeset/22293

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
Log:
[Bug 680613] Date format setting seems to be ignored since version 2.4.9

Work around strange side-effect of r21665 which caused LC_TIME to be
changed after it had been set by setlocale(LC_ALL) in set_mac_locale().

BP

Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2012-08-07 18:24:13 UTC (rev 22292)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2012-08-08 05:38:34 UTC (rev 22293)
@@ -284,9 +284,11 @@
 			    [locale objectForKey: NSLocaleCountryCode]];
 /* If we didn't get a valid current locale, the string will be just "_" */
     if ([locale_str isEqualToString: @"_"])
-	setlocale(LC_ALL, "en_US");
-    else
-	setlocale(LC_ALL, [locale_str UTF8String]);
+	locale_str = @"en_US";
+
+    setlocale(LC_ALL, [locale_str UTF8String]);
+    if (g_getenv("LANG") == NULL)
+	g_setenv("LANG", [locale_str UTF8String], TRUE);
 /* If the currency doesn't match the base locale, we need to find a locale that does match, because setlocale won't know what to do with just a currency identifier. */
     if (![[locale objectForKey: NSLocaleCurrencyCode] isEqualToString:
 	  [[[NSLocale alloc] initWithLocaleIdentifier: locale_str] objectForKey: NSLocaleCurrencyCode]]) {



More information about the gnucash-changes mailing list