From 109fef8208188ddf4be76d6899f7d8fde5b8b3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sat, 22 Jul 2023 14:40:31 +0800 Subject: [PATCH] Use TZDIR for ZONEINFO_DIR if the variable is set. --- libmateweather/mateweather-timezone.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libmateweather/mateweather-timezone.c b/libmateweather/mateweather-timezone.c index 2754728..6c858c4 100644 --- a/libmateweather/mateweather-timezone.c +++ b/libmateweather/mateweather-timezone.c @@ -61,7 +61,7 @@ static gboolean parse_tzdata (const char *tzname, time_t start, time_t end, int *offset, gboolean *has_dst, int *dst_offset) { - char *filename, *contents; + char *tzdir, *filename, *contents; gsize length; int timecnt, transitions_size, ttinfo_map_size; int initial_transition = -1, second_transition = -1; @@ -71,7 +71,10 @@ parse_tzdata (const char *tzname, time_t start, time_t end, char initial_isdst, second_isdst; int i; - filename = g_build_filename (ZONEINFO_DIR, tzname, NULL); + tzdir = g_getenv("TZDIR"); + if (tzdir == NULL) + tzdir = ZONEINFO_DIR; + filename = g_build_filename (tzdir, tzname, NULL); if (!g_file_get_contents (filename, &contents, &length, NULL)) { g_free (filename); return FALSE; @@ -403,4 +406,3 @@ mateweather_timezone_get_dst_offset (MateWeatherTimezone *zone) g_return_val_if_fail (zone->has_dst, 0); return zone->dst_offset; } - -- 2.41.0 7ce9b7e7062eee406e269bc40a20247973732be2'/>
path: root/THANKS
an>
AgeCommit message (Expand)Author
2021-09-12Thank Christine under her updated name.Christine Lemmer-Webber
doc: Update URLs for the manual and cookbook translations....* doc/htmlxref.cnf: Update URLs for "guix" and "guix-cookbook". Ludovic Courtès
2022-12-18doc: Add guile-netlink to 'htmlxref.cnf'....* doc/htmlxref.cnf: Add guile-netlink. Ludovic Courtès
2022-08-05doc: Fix Guix manual URLs in 'htmlxref.cnf'....Fixes a regression introduced in 868da34d54365023223a4ff7520043ba55ad64e8. * doc/htmlxref.cnf (GUIX): Remove "/guix". Ludovic Courtès
2022-06-16doc: Remove obsolete comment from htmlxref.cnf....This is follow up to <https://issues.guix.gnu.org/55290>. * doc/htmlxref.cnf (geiser): Delete obsolete comment. Maxim Cournoyer
2022-04-08doc: Fix cookbook URLs in htmlxref.cnf....Reported by Greg Hogan <code@greghogan.com>. * doc/htmlxref.cnf (GUIX_ROOT): New variable. (GUIX, GUIX_COOKBOOK): Adjust. Ludovic Courtès
2021-10-04doc: Update htmlxref.cnf....Update and fix broken references to cuirass, git, and guix-cookbook. * doc/htmlxref.cnf: Update from Texinfo. Factorize Guix manuals. (cuirass, git, guix-cookbook, guix-cookbook.de, guix-cookbook.fr): New entries. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Sarah Morgensen
2021-04-24doc: Fix cross-reference URL to translated manual....* doc/htmlxref.cnf: Fix translated manual URL. Julien Lepiller