2017-09-18 03:25:11 +02:00
|
|
|
--- a/src/libical/icaltz-util.c
|
|
|
|
+++ b/src/libical/icaltz-util.c
|
|
|
|
@@ -96,9 +96,9 @@ typedef struct
|
2012-08-08 11:10:36 +02:00
|
|
|
static char *zdir = NULL;
|
|
|
|
|
2017-09-18 03:25:11 +02:00
|
|
|
static char *search_paths[] = {
|
|
|
|
+ "/etc/zoneinfo",
|
|
|
|
"/usr/share/zoneinfo",
|
|
|
|
"/usr/lib/zoneinfo",
|
|
|
|
- "/etc/zoneinfo",
|
|
|
|
"/usr/share/lib/zoneinfo"
|
|
|
|
};
|
|
|
|
|
|
|
|
@@ -179,6 +179,15 @@ static void set_zonedir(void)
|
|
|
|
const char *fname = ZONES_TAB_SYSTEM_FILENAME;
|
|
|
|
size_t i, num_search_paths;
|
2012-08-08 11:10:36 +02:00
|
|
|
|
2017-09-18 03:25:11 +02:00
|
|
|
+ const char *env_tzdir = getenv ("TZDIR");
|
|
|
|
+ if (env_tzdir) {
|
|
|
|
+ snprintf(file_path, MAXPATHLEN, "%s/%s", env_tzdir, fname);
|
|
|
|
+ if (!access (file_path, F_OK|R_OK)) {
|
|
|
|
+ zdir = env_tzdir;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
2012-08-08 11:10:36 +02:00
|
|
|
+
|
2017-09-18 03:25:11 +02:00
|
|
|
num_search_paths = sizeof(search_paths) / sizeof(search_paths[0]);
|
|
|
|
for (i = 0; i < num_search_paths; i++) {
|
|
|
|
snprintf(file_path, MAXPATHLEN, "%s/%s", search_paths[i], fname);
|