Fix bug: Remind would sometimes compute incorrect trigger date for:

REM 29 Feb SOME_WEEKDAY MSG ...
This commit is contained in:
Dianne Skoll
2021-04-13 12:21:37 -04:00
parent 14edec5eae
commit 664fa5f08f
3 changed files with 8 additions and 0 deletions

View File

@@ -221,6 +221,7 @@ static int NextSimpleTrig(int startdate, Trigger *trig, int *err)
/* Try this year */
y++;
while (trig->d > DaysInMonth(trig->m, y)) y++;
j = Julian(y, trig->m, trig->d);
ADVANCE_TO_WD(j, trig->wd);
if (j >= startdate) return j;

View File

@@ -65,6 +65,10 @@ echo "" >> ../tests/test.out
chmod 644 include_dir/04cantread.rem
# Feb 29 bug
echo "Feb 29 Bug Test" >> ../tests/test.out
echo 'REM Sun 29 Feb MSG [$T]' | ../src/remind -dt - 1 feb 2021 >> ../tests/test.out 2>&1
echo "Color Test" >> ../tests/test.out
../src/remind -ccl ../tests/colors.rem 1 aug 2007 >> ../tests/test.out 2>&1

View File

@@ -4240,6 +4240,9 @@ September 30
# fileinfo 5 ../tests/include_test.rem
2007/08/15 * * * * Whee!!!!
# rem2ps end
Feb 29 Bug Test
-(1): Trig = Sunday, 3 March, 2024
No reminders.
Color Test
(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk(B
(0x(B August 2007 (0x(B