From 0439b0b648ff7b7cced23c51ddcc2debb9d445eb Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 9 Jan 2020 22:37:31 +0000 Subject: [PATCH] gtimezone: fix inverted ignore_leap param parsing julian day The callers of parse_tz_boundary inverted the value passed for the ignore_leap parameter. Fortunately the method impl also had an inverted test cancelling out the first bug. Signed-off-by: Daniel P. Berrange --- glib/gtimezone.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glib/gtimezone.c b/glib/gtimezone.c index 9206388e3..bebe156ae 100644 --- a/glib/gtimezone.c +++ b/glib/gtimezone.c @@ -1231,7 +1231,7 @@ parse_julian_boundary (gchar** pos, TimeZoneDate *boundary, boundary->mday = (int) g_date_get_day (&date); boundary->wday = 0; - if (!ignore_leap && day >= 59) + if (ignore_leap && day >= 59) boundary->mday++; return TRUE; @@ -1255,13 +1255,13 @@ parse_tz_boundary (const gchar *identifier, else if (*pos == 'J') { ++pos; - if (!parse_julian_boundary (&pos, boundary, FALSE)) + if (!parse_julian_boundary (&pos, boundary, TRUE)) return FALSE ; } /* Julian date which counts Feb 29 in leap years */ else if (*pos >= '0' && '9' >= *pos) { - if (!parse_julian_boundary (&pos, boundary, TRUE)) + if (!parse_julian_boundary (&pos, boundary, FALSE)) return FALSE; } else