aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhale <jhale@FreeBSD.org>2017-07-31 21:07:22 +0800
committerjhale <jhale@FreeBSD.org>2017-07-31 21:07:22 +0800
commit0a0b5b1e3dee1a70cf2f82ebdb54f7c7cd2d9858 (patch)
treef7f354e7f104cabaa2c8d2170c1c160062b6e103
parentddc7165f01c0569d8ddcc8512f07b1f7089a9391 (diff)
downloadfreebsd-ports-gnome-0a0b5b1e3dee1a70cf2f82ebdb54f7c7cd2d9858.tar.gz
freebsd-ports-gnome-0a0b5b1e3dee1a70cf2f82ebdb54f7c7cd2d9858.tar.zst
freebsd-ports-gnome-0a0b5b1e3dee1a70cf2f82ebdb54f7c7cd2d9858.zip
Fix Daylight Saving Time (DST) detection. Previous patch was erroneously
dectecting whether DST is currently in effect for the timezone (TZ) in use instead of emulating the glibc global daylight variable which is set to 0 if DST conversions should never be applied for the TZ in use; otherwise non-zero. PR: 220665 Submitted by: madpilot MFH: 2017Q3
-rw-r--r--finance/libofx/Makefile1
-rw-r--r--finance/libofx/files/patch-lib_ofx__utilities.cpp18
2 files changed, 8 insertions, 11 deletions
diff --git a/finance/libofx/Makefile b/finance/libofx/Makefile
index 57055cfd9f64..79adb955d089 100644
--- a/finance/libofx/Makefile
+++ b/finance/libofx/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libofx
PORTVERSION= 0.9.11
+PORTREVISION= 1
CATEGORIES= finance
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}
diff --git a/finance/libofx/files/patch-lib_ofx__utilities.cpp b/finance/libofx/files/patch-lib_ofx__utilities.cpp
index 6f7f6350b0cb..2b9730760fcb 100644
--- a/finance/libofx/files/patch-lib_ofx__utilities.cpp
+++ b/finance/libofx/files/patch-lib_ofx__utilities.cpp
@@ -1,18 +1,14 @@
--- lib/ofx_utilities.cpp.orig 2013-04-16 19:50:51 UTC
+++ lib/ofx_utilities.cpp
-@@ -115,9 +115,14 @@ time_t ofxdate_to_time_t(const string of
+@@ -115,6 +115,11 @@ time_t ofxdate_to_time_t(const string ofxdate)
char time_zone_specified = false;
string ofxdate_whole;
time_t temptime;
-+ int daylight;
-+ const struct tm* t;
-+
-+ std::time(&temptime);
-+ t = localtime(&temptime);
-+ daylight = t->tm_isdst;
++ int daylight = 0;
++
++ tzset();
++ if(tzname[1][0] != ' ')
++ daylight = 1;
time.tm_isdst = daylight; // initialize dst setting
-- std::time(&temptime);
- local_offset = difftime(mktime(localtime(&temptime)), mktime(gmtime(&temptime))) + (3600 * daylight);
-
- if (ofxdate.size() != 0)
+ std::time(&temptime);