diff options
author | Clement Lefebvre <[email protected]> | 2019-12-11 15:47:51 +0000 |
---|---|---|
committer | monsta <[email protected]> | 2019-12-13 15:15:25 +0300 |
commit | 666ee49426b7353c77e93268fb4c73505f8a1dd5 (patch) | |
tree | fbc358ab6e218ecdebb00e66196dac526e2000f3 /applets/clock/clock.c | |
parent | 2d88f6f2a819cc251d4e7ec4a3750ce368fa7bf2 (diff) | |
download | mate-panel-666ee49426b7353c77e93268fb4c73505f8a1dd5.tar.bz2 mate-panel-666ee49426b7353c77e93268fb4c73505f8a1dd5.tar.xz |
Clock applet: Fix string comparison
Diffstat (limited to 'applets/clock/clock.c')
-rw-r--r-- | applets/clock/clock.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c index b5504e94..3f9d473f 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -428,6 +428,7 @@ get_updated_timeformat (ClockData *cd) char *clock_format; const gchar *env_language; const gchar *env_lc_time; + gboolean use_lctime; /* Override LANGUAGE with the LC_TIME environment variable * This is needed for gettext to fetch our clock format @@ -435,7 +436,9 @@ get_updated_timeformat (ClockData *cd) */ env_language = g_getenv("LANGUAGE"); env_lc_time = g_getenv("LC_TIME"); - if (env_language != NULL && env_lc_time != NULL && env_language != env_lc_time) { + use_lctime = (env_language != NULL) && (env_lc_time != NULL) && (g_strcmp0 (env_language, env_lc_time) != 0); + + if (use_lctime) { g_setenv("LANGUAGE", env_lc_time, TRUE); } @@ -480,7 +483,7 @@ get_updated_timeformat (ClockData *cd) } /* Set back LANGUAGE the way it was before */ - if (env_language != NULL && env_lc_time != NULL && env_language != env_lc_time) { + if (use_lctime) { g_setenv("LANGUAGE", env_language, TRUE); } |