From d2da70fb285693384bae3c27f658f851a91ee0dc Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 16 Apr 2020 16:15:34 -0300 Subject: [PATCH] range: Properly compare ranges The behavior of gcal_range_compare(), and the 'position' argument of gcal_range_calculate_overlap(), should be the same. However, because we were comparing the end dates in the wrong order, they didn't match. Fix that by properly comparing the end of the ranges. --- src/core/gcal-range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/gcal-range.c b/src/core/gcal-range.c index d64cf3be..9aeb5c7f 100644 --- a/src/core/gcal-range.c +++ b/src/core/gcal-range.c @@ -422,7 +422,7 @@ gcal_range_compare (GcalRange *a, result = compare_func (a->range_start, b->range_start); if (result == 0) - result = compare_func (b->range_end, a->range_end); + result = compare_func (a->range_end, b->range_end); return result; }