aboutsummaryrefslogtreecommitdiff
path: root/intl.c
diff options
context:
space:
mode:
authorSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:31 -0500
committerSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:31 -0500
commita08438bda21b3e0d7db2db2360d040841970104d (patch)
treef8a13a1e368bfbd14fe2d9492d6d5824eb5712ce /intl.c
parent8c1612d32c5682a86216adb8c8d11ce715fe5475 (diff)
Import Upstream version 0.3.7pre
Diffstat (limited to 'intl.c')
-rw-r--r--intl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/intl.c b/intl.c
index e0817b51..82ac163f 100644
--- a/intl.c
+++ b/intl.c
@@ -41,7 +41,8 @@ void intl_init(void)
}
/*
- * GNU's gettext is cool and all... but hey, this is smaller :)
+ * GNU's gettext is cool and all... but hey, this is smaller,
+ * but slower :P
*/
const gchar *
intl_translate(const gchar * string, const gchar * source) __THROW
@@ -50,7 +51,7 @@ intl_translate(const gchar * string, const gchar * source) __THROW
gchar buffer[256], *keyname, *lang = NULL, *langenv = NULL;
const gchar *retval, *langvars[] =
{"LANG", "LC_MESSAGES", "LC_ALL", NULL};
- gboolean found;
+ gboolean found = FALSE;
struct stat st;
gint i = 0;
@@ -67,6 +68,7 @@ intl_translate(const gchar * string, const gchar * source) __THROW
langenv_ok:
lang = g_strconcat(INTL_PREFIX, langenv, ".lang", NULL);
if (stat(lang, &st)) {
+ g_free(lang);
lang = g_strconcat(INTL_PREFIX, "default.lang", NULL);
if (stat(lang, &st)) {
not_found: