Skip to content

Commit

Permalink
Merge PR116 into maint.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed May 3, 2018
2 parents a9f35ed + 1b814f4 commit 5aacb58
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gnucash/import-export/ofx/gnc-ofx-import.c
Expand Up @@ -337,8 +337,25 @@ fix_ofx_bug_39 (time64 t)
{
#if HAVE_OFX_BUG_39
struct tm stm;

#ifdef __FreeBSD__
time64 now;
/*
* FreeBSD has it's own libc implementation which differs from glibc. In particular:
* There is no daylight global
* tzname members are set to the string " " (three spaces) when not explicitly populated
*
* To check that the current timezone does not observe DST I check if tzname[1] starts with a space.
*/
now = gnc_time (NULL);
gnc_localtime_r(&now, &stm);
tzset();

if (tzname[1][0] != ' ' && !stm.tm_isdst)
#else
gnc_localtime_r(&t, &stm);
if (daylight && !stm.tm_isdst)
#endif
t += 3600;
#endif
return t;
Expand Down

0 comments on commit 5aacb58

Please sign in to comment.