summaryrefslogtreecommitdiff
path: root/applets/clock/system-timezone.c
diff options
context:
space:
mode:
Diffstat (limited to 'applets/clock/system-timezone.c')
-rw-r--r--applets/clock/system-timezone.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/applets/clock/system-timezone.c b/applets/clock/system-timezone.c
index 28b3525b..b736ffee 100644
--- a/applets/clock/system-timezone.c
+++ b/applets/clock/system-timezone.c
@@ -634,6 +634,22 @@ system_timezone_read_etc_localtime_softlink (void)
return NULL;
file = g_file_read_link (ETC_LOCALTIME, NULL);
+
+ if (!g_path_is_absolute (file)) {
+ GFile *gf1;
+ GFile *gf2;
+
+ /* Resolve relative path. */
+ gf1 = g_file_new_for_path (ETC_LOCALTIME);
+ gf2 = g_file_get_parent (gf1);
+ g_object_unref (gf1);
+ gf1 = g_file_resolve_relative_path (gf2, file);
+ g_object_unref (gf2);
+ g_free (file);
+ file = g_file_get_path (gf1);
+ g_object_unref (gf1);
+ }
+
tz = system_timezone_strip_path_if_valid (file);
g_free (file);