From e91e84e7edcc284df6a06d9ad9a239d48058a55f Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 15 Jan 2020 16:23:34 +0100 Subject: [PATCH] Bug 797569 - Swedish account templates not accessible Turned out to be a bug introduced by our port to cmake. The Windows special casing for Swedish account hierarchies was never called at all. This fix includes a fix for a const correctness compiler warning as well. --- gnucash/gnome/assistant-hierarchy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gnucash/gnome/assistant-hierarchy.c b/gnucash/gnome/assistant-hierarchy.c index 72c6e74551..9f8bf5443c 100644 --- a/gnucash/gnome/assistant-hierarchy.c +++ b/gnucash/gnome/assistant-hierarchy.c @@ -235,19 +235,20 @@ gnc_get_ea_locale_dir(const char *top_dir) GStatBuf buf; int i; -#ifdef PLATFORM_WIN32 +#if PLATFORM(WINDOWS) /* On win32, setlocale() doesn't say anything useful, so we check * g_win32_getlocale(). Unfortunately it checks the value of $LANG first, * and the user might have worked around the absence of sv in gettext's * Microsoft Conversion Array by setting it to "Swedish_Sweden", so first * check that. */ - locale = g_getenv("LANG"); - if (g_strcmp0(locale, "Swedish_Sweden") == 0) + const gchar *env_locale; + env_locale = g_getenv("LANG"); + if (g_strcmp0(env_locale, "Swedish_Sweden") == 0) locale = g_strdup("sv_SE"); - else if (g_strcmp0(locale, "Swedish_Finland") == 0) + else if (g_strcmp0(env_locale, "Swedish_Finland") == 0) locale =g_strdup("sv_FI"); - else if (g_strcmp0(locale, "Swedish_Åland Islands") == 0) + else if (g_strcmp0(env_locale, "Swedish_Åland Islands") == 0) locale =g_strdup("sv_AX"); else {