aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-xml-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-xml-utils.c')
-rw-r--r--e-util/e-xml-utils.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
index 52c7d6fe77..4f919fcacd 100644
--- a/e-util/e-xml-utils.c
+++ b/e-util/e-xml-utils.c
@@ -73,6 +73,9 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent,
const xmlChar *child_name,
const gchar *lang)
{
+#ifdef G_OS_WIN32
+ gchar *freeme = NULL;
+#endif
xmlNode *child;
/* This is the default version of the string. */
xmlNode *C = NULL;
@@ -81,22 +84,32 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent,
g_return_val_if_fail (child_name != NULL, NULL);
if (lang == NULL) {
+#ifndef G_OS_WIN32
#ifdef HAVE_LC_MESSAGES
lang = setlocale (LC_MESSAGES, NULL);
#else
lang = setlocale (LC_CTYPE, NULL);
#endif
+#else
+ lang = freeme = g_win32_getlocale ();
+#endif
}
for (child = parent->xmlChildrenNode; child != NULL; child = child->next) {
if (xmlStrcmp (child->name, child_name) == 0) {
xmlChar *this_lang = xmlGetProp (child, "lang");
if (this_lang == NULL) {
C = child;
- } else if (xmlStrcmp(this_lang, "lang") == 0) {
+ } else if (xmlStrcmp(this_lang, lang) == 0) {
+#ifdef G_OS_WIN32
+ g_free (freeme);
+#endif
return child;
}
}
}
+#ifdef G_OS_WIN32
+ g_free (freeme);
+#endif
return C;
}