aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-09-05 13:24:28 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-09-05 13:24:28 -0500
commit86333cb7f91ef594088ded32927454940745d96d (patch)
tree372156fc3db18bc8ed8b35474f73287e7668a16b /src/utils.c
parentfdd57db6d6a81951da34675ee89e6e0f1b77b59e (diff)
downloadayatana-indicator-datetime-86333cb7f91ef594088ded32927454940745d96d.tar.gz
ayatana-indicator-datetime-86333cb7f91ef594088ded32927454940745d96d.tar.bz2
ayatana-indicator-datetime-86333cb7f91ef594088ded32927454940745d96d.zip
in our private T_() function, avoid a couple of unnecessary strdup & frees
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c
index b99de94..50d896d 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -134,9 +134,9 @@ T_(const char *msg)
LC_MESSAGES directory, so we won't find any translation there.
*/
char *message_locale = g_strdup(setlocale(LC_MESSAGES, NULL));
- char *time_locale = g_strdup(setlocale(LC_TIME, NULL));
+ const char *time_locale = setlocale (LC_TIME, NULL);
char *language = g_strdup(g_getenv("LANGUAGE"));
- char *rv;
+ const char *rv;
if (language)
g_unsetenv("LANGUAGE");
setlocale(LC_MESSAGES, time_locale);
@@ -149,7 +149,6 @@ T_(const char *msg)
if (language)
g_setenv("LANGUAGE", language, TRUE);
g_free(message_locale);
- g_free(time_locale);
g_free(language);
return rv;
}