diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2011-09-28 15:01:10 +1000 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2011-09-28 15:01:10 +1000 |
commit | 43a5a69eac9dcad57a13a0b14a4b3de50b75e2f8 (patch) | |
tree | 3c0718a3ce8ca09d80a547e8386ece72593d2dac | |
parent | b1bbe3c1e2af12078d9a77d55e6f87a67b3f02c3 (diff) | |
download | ayatana-indicator-datetime-43a5a69eac9dcad57a13a0b14a4b3de50b75e2f8.tar.gz ayatana-indicator-datetime-43a5a69eac9dcad57a13a0b14a4b3de50b75e2f8.tar.bz2 ayatana-indicator-datetime-43a5a69eac9dcad57a13a0b14a4b3de50b75e2f8.zip |
Don't call setenv when value is NULL
-rw-r--r-- | src/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c index 73c8ab2..e6de92a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -161,7 +161,8 @@ T_(const char *msg) char *time_locale = g_strdup(setlocale(LC_TIME, NULL)); char *language = g_strdup(g_getenv("LANGUAGE")); char *rv; - g_unsetenv("LANGUAGE"); + if (language) + g_unsetenv("LANGUAGE"); setlocale(LC_MESSAGES, time_locale); /* Get the LC_TIME version */ @@ -169,7 +170,8 @@ T_(const char *msg) /* Put everything back the way it was */ setlocale(LC_MESSAGES, message_locale); - g_setenv("LANGUAGE", language, TRUE); + if (language) + g_setenv("LANGUAGE", language, TRUE); g_free(message_locale); g_free(time_locale); g_free(language); |