[libxml2] Partial fix for comparison of xs:durations



commit e3f1c7f751192d8f271a86e314ab12556293786b
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Aug 25 14:12:23 2019 +0200

    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.

 xmlschemastypes.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
old mode 100644
new mode 100755
index 376d6d8e..1450781f
--- 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;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]