Fix parsing of "PnM" recurrence periods

Due to not accounting for the leading "P", getNextRecurrence would always return the same datetime, breaking all generic "PnM" periods and leading to an infinite loop in generateDueDates.
This commit is contained in:
Michał Mirosław
2020-02-21 17:32:49 +01:00
committed by Paul Beckingham
parent e0f24c0b19
commit 7b2e68d176

View File

@@ -251,7 +251,7 @@ Datetime getNextRecurrence (Datetime& current, std::string& period)
Lexer::isAllDigits (period.substr (1, period.length () - 2)) &&
period[period.length () - 1] == 'M')
{
int increment = strtol (period.substr (0, period.length () - 1).c_str (), nullptr, 10);
int increment = strtol (period.substr (1, period.length () - 2).c_str (), nullptr, 10);
m += increment;
while (m > 12)