From 432bab81f970d2dab1afcb939485184b26120d22 Mon Sep 17 00:00:00 2001 From: LarsGullik Date: Tue, 27 Oct 2020 15:08:30 +0100 Subject: [PATCH] Skip "version" file and USE_OS_TZDB to return "unknown" if no version found (#616) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit commit 0b72599bd43f72d8935e507e25e4f0063f9bb34e there was a change to read "version" in addition to "+VERSION", so that file shold also be ignored when scanning/reading zonefiles. Also before the above mentioed commit get_version() would return "unknown" if not on __APPLE__ and the version file was not found. Put back that behaviour, for all USE_OS_TZDB users. This last change changes the behaviour for __APPLE__ from throwing an exception to returning "unknown". Co-authored-by: Lars Gullik Bjønnes --- src/tz.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tz.cpp b/src/tz.cpp index 78ab35f..7cbdbcb 100644 --- a/src/tz.cpp +++ b/src/tz.cpp @@ -2651,7 +2651,7 @@ get_version() in >> version; return version; } - return version; + return "unknown"; } static @@ -2760,6 +2760,7 @@ init_tzdb() strcmp(d->d_name, "iso3166.tab") == 0 || strcmp(d->d_name, "right") == 0 || strcmp(d->d_name, "+VERSION") == 0 || + strcmp(d->d_name, "version") == 0 || strcmp(d->d_name, "zone.tab") == 0 || strcmp(d->d_name, "zone1970.tab") == 0 || strcmp(d->d_name, "tzdata.zi") == 0 ||