From 61647e0f260702193f40e31eaf5a5f534f1c6484 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 4 Jul 2016 13:08:52 -0400 Subject: [PATCH] data: merge error skips one range --- src/Exclusion.cpp | 2 +- src/data.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Exclusion.cpp b/src/Exclusion.cpp index b220edf5..fbe1d1c6 100644 --- a/src/Exclusion.cpp +++ b/src/Exclusion.cpp @@ -120,7 +120,7 @@ std::vector Exclusion::ranges (const Range& range) const else if ((dayOfWeek = Datetime::dayOfWeek (_tokens[1])) != -1) { Datetime start (range.start.year (), range.start.month (), range.start.day (), 0, 0, 0); - while (start < range.end) + while (start <= range.end) { if (start.dayOfWeek () == dayOfWeek) { diff --git a/src/data.cpp b/src/data.cpp index adcf101b..f4889dbb 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -295,7 +295,7 @@ std::vector getAllExclusions ( results = subtractRanges (results, daysOn); // Expand all exclusions that are not 'exc day ...' into excluded ranges that - // overlage with range. + // overlap with range. std::vector exclusionRanges; for (auto& exclusion : exclusions) if (exclusion.tokens ()[1] != "day") @@ -459,6 +459,7 @@ std::vector merge ( } else { + sorted[cursor] = sorted[i]; ++cursor; } }