summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2019-08-25 14:12:23 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2019-08-25 14:12:23 +0200
commite3f1c7f751192d8f271a86e314ab12556293786b (patch)
tree9a73ffec982b2fb625a7e9383b0676f34d1e9f96
parent39f10232b50959ec5193cb3fcbaf9fed8ce0680f (diff)
downloadlibxml2-e3f1c7f751192d8f271a86e314ab12556293786b.tar.gz
Partial fix for comparison of xs:durations
See https://bugzilla.gnome.org/show_bug.cgi?id=777139 Thanks to Zhongyuan Zhou for the initial merge request !34.
-rwxr-xr-x[-rw-r--r--]xmlschemastypes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 376d6d8e..1450781f 100644..100755
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -3628,8 +3628,10 @@ xmlSchemaCompareDurations(xmlSchemaValPtr x, xmlSchemaValPtr y)
minday = 0;
maxday = 0;
} else {
- maxday = 366 * ((myear + 3) / 4) +
- 365 * ((myear - 1) % 4);
+ /* FIXME: This doesn't take leap year exceptions every 100/400 years
+ into account. */
+ maxday = 365 * myear + (myear + 3) / 4;
+ /* FIXME: Needs to be calculated separately */
minday = maxday - 1;
}