mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 06:48:47 +02:00
Fix bug in handling of WKDAY DAY YEAR date specification.
This commit is contained in:
@@ -185,6 +185,7 @@ static int NextSimpleTrig(int startdate, Trigger *trig, int *err)
|
||||
while (trig->d > DaysInMonth(m2, trig->y)) m2--;
|
||||
j = Julian(trig->y, m2, trig->d);
|
||||
ADVANCE_TO_WD(j, trig->wd);
|
||||
if (JYear(j) > trig->y) return -1;
|
||||
if (j >= startdate) return j;
|
||||
}
|
||||
}
|
||||
@@ -192,6 +193,7 @@ static int NextSimpleTrig(int startdate, Trigger *trig, int *err)
|
||||
if (trig->d <= DaysInMonth(m, trig->y)) {
|
||||
j = Julian(trig->y, m, trig->d);
|
||||
ADVANCE_TO_WD(j, trig->wd);
|
||||
if (JYear(j) > trig->y) return -1;
|
||||
if (j >= startdate) return j;
|
||||
}
|
||||
|
||||
@@ -201,6 +203,7 @@ static int NextSimpleTrig(int startdate, Trigger *trig, int *err)
|
||||
while (trig->d > DaysInMonth(m, trig->d)) m++;
|
||||
j = Julian(trig->y, m, trig->d);
|
||||
ADVANCE_TO_WD(j, trig->wd);
|
||||
if (JYear(j) > trig->y) return -1;
|
||||
return j;
|
||||
|
||||
case GOT_DAY+GOT_MON+GOT_WD:
|
||||
|
||||
@@ -69,6 +69,10 @@ chmod 644 include_dir/04cantread.rem
|
||||
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
|
||||
|
||||
# Day Weekday Year out-of-year bug
|
||||
echo "Mon 31 Dec Bug Test" >> ../tests/test.out
|
||||
echo 'REM Mon 31 2021 MSG [$T]' | ../src/remind -dt - 31 dec 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
|
||||
|
||||
|
||||
@@ -4243,6 +4243,9 @@ September 30
|
||||
Feb 29 Bug Test
|
||||
-(1): Trig = Sunday, 3 March, 2024
|
||||
No reminders.
|
||||
Mon 31 Dec Bug Test
|
||||
-(1): Expired
|
||||
No reminders.
|
||||
Color Test
|
||||
(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk(B
|
||||
(0x(B August 2007 (0x(B
|
||||
|
||||
Reference in New Issue
Block a user