Don't make SHADE specials obliterate MOON specials. Fixes ticket 15068.

This commit is contained in:
David F. Skoll
2009-10-05 14:33:51 -04:00
parent aae76207ec
commit 08be7c43cf
4 changed files with 1131 additions and 3 deletions

View File

@@ -186,7 +186,7 @@ void DoPsCal(void)
char const *startOfBody;
char passthru[PASSTHRU_LEN+1];
DynamicBuffer buf;
CalEntry *c, *d;
CalEntry *c, *d, *p;
/* Read the month and year name, followed by # days in month and 1st day of
month */
@@ -336,8 +336,23 @@ void DoPsCal(void)
PsEntries[DayNum] = c;
} else {
d = PsEntries[DayNum];
while(d->next) d = d->next;
d->next = c;
p = NULL;
/* Slot it into the right place */
while (d->next && (c->special <= d->special)) {
p = d;
d = d->next;
}
if (c->special <= d->special) {
c->next = d->next;
d->next = c;
} else {
if (p) {
p->next = c;
} else {
PsEntries[DayNum] = c;
}
c->next = d;
}
}
} else if (!strcmp(passthru, "*") ||
!strcmp(passthru, "COLOR")) {

15
tests/shade.rem Normal file
View File

@@ -0,0 +1,15 @@
IF $PSCAL
[trigger(moondate(0))] SPECIAL MOON 0 -1 -1 [moontime(0)]
[trigger(moondate(1))] SPECIAL MOON 1 -1 -1 [moontime(1)]
[trigger(moondate(2))] SPECIAL MOON 2 -1 -1 [moontime(2)]
[trigger(moondate(3))] SPECIAL MOON 3 -1 -1 [moontime(3)]
ENDIF
REM Mon SPECIAL SHADE 255 255 255
REM Tue SPECIAL SHADE 255 255 204
REM Wed SPECIAL SHADE 255 204 255
REM Thu SPECIAL SHADE 204 255 255
REM Fri SPECIAL SHADE 255 204 204
REM Sat SPECIAL SHADE 204 255 204
REM Sun SPECIAL SHADE 204 204 255

View File

@@ -69,6 +69,8 @@ echo "Sort Test" >> ../tests/test.out
../src/remind ../tests/runtest.rem >> ../tests/test.out 2>&1
../src/remind -p ../tests/shade.rem 1 August 2009 | ../src/rem2ps -e -l -c3 >> ../tests/test.out 2>&1
cmp -s ../tests/test.out ../tests/test.cmp
if [ "$?" = "0" ]; then
echo "Remind: Acceptance test PASSED"

File diff suppressed because it is too large Load Diff