diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-09-07 07:41:59 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-09-07 07:41:59 -0500 |
commit | 1e5db71bcfbc88fd45c4d3af3e477a1829d99509 (patch) | |
tree | 1fa5d1e7ba3813506780fde1227c4b09beeb2207 | |
parent | ddebe3c47040869cb8fe94729c43f10f2b763550 (diff) | |
parent | 86333cb7f91ef594088ded32927454940745d96d (diff) | |
download | ayatana-indicator-datetime-1e5db71bcfbc88fd45c4d3af3e477a1829d99509.tar.gz ayatana-indicator-datetime-1e5db71bcfbc88fd45c4d3af3e477a1829d99509.tar.bz2 ayatana-indicator-datetime-1e5db71bcfbc88fd45c4d3af3e477a1829d99509.zip |
in utils.c's T_(), avoid an unnecessary strdup/free
-rw-r--r-- | src/utils.c | 5 |
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; } |