From 2375270eb782a23ce4ad58715b4daab28d2e5bed Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 20 Jun 2016 15:29:21 -0700 Subject: [PATCH] Fix gnc_iso8601_to_timespec_gmt test failure. Triggered by colon in the zone string. --- src/libqof/qof/gnc-date.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libqof/qof/gnc-date.c b/src/libqof/qof/gnc-date.c index d06a02800a..d84e950984 100644 --- a/src/libqof/qof/gnc-date.c +++ b/src/libqof/qof/gnc-date.c @@ -1440,8 +1440,14 @@ gnc_iso8601_to_timespec_gmt(const char *str) GTimeZone *tz = NULL; time64 secs; int plus = strspn(zone, "+-"); - long offset = strtol(zone, NULL, 10); + char *colon = NULL; + long offset = strtol(zone, &colon, 10); gboolean adjust_time = FALSE; + if (colon != NULL) + { + long zone_minutes = strtol(colon + 1, NULL, 10); + offset = 100 * offset + zone_minutes; + } /* Bug 767824: A GLib bug in parsing the UTC timezone on * Windows may have created a bogus timezone of a random * number of minutes. Since there are no fractional-hour