Don't let THROUGH date be before START date in OMIT.

This commit is contained in:
Dianne Skoll
2022-07-27 14:55:34 -04:00
parent ac1303886e
commit d6575773fb
3 changed files with 8 additions and 4 deletions

View File

@@ -428,11 +428,10 @@ int DoOmit(ParsePtr p)
start = Julian(y[0], m[0], d[0]);
end = Julian(y[1], m[1], d[1]);
if (end < start) {
Wprint("Warning: Swapping dates on OMIT ... THROUGH ... line");
tmp = start;
start = end;
end = tmp;
Eprint("Error: THROUGH date earlier than start date");
return E_BAD_DATE;
}
for (tmp = start; tmp <= end; tmp++) {
if (!BexistsIntArray(FullOmitArray, NumFullOmits, tmp)) {
if (NumFullOmits >= MAX_FULL_OMITS) return E_2MANY_FULL;

View File

@@ -4052,6 +4052,9 @@ CLEAR-OMIT-CONTEXT
OMIT 2000-01-01 THROUGH 2020-12-31
../tests/test.rem(812): Too many full OMITs
OMIT Dec 5 2029 through Dec 4 2029
../tests/test.rem(814): Error: THROUGH date earlier than start date
# Don't want Remind to queue reminders
EXIT

View File

@@ -811,6 +811,8 @@ OMIT DUMP
CLEAR-OMIT-CONTEXT
OMIT 2000-01-01 THROUGH 2020-12-31
OMIT Dec 5 2029 through Dec 4 2029
# Don't want Remind to queue reminders
EXIT