diff --git a/Makefile b/Makefile index eafb79ca..8f702d05 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,14 @@ clean: find . -name '*~' -exec rm {} \; cd src; $(MAKE) clean +test: + cd src && $(MAKE) test + distclean: clean rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out src/Makefile: src/Makefile.in ./configure + # DO NOT DELETE + diff --git a/src/calendar.c b/src/calendar.c index ff2864cd..78198b23 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -641,25 +641,27 @@ static int DoCalRem(ParsePtr p, int col) } if (trig.typ == PASSTHRU_TYPE) { if (!PsCal && strcmp(trig.passthru, "COLOR")) return OK; - /* Strip off the three color numbers */ - DBufFree(&buf); - r=ParseToken(p, &buf); - DBufPuts(&pre_buf, DBufValue(&buf)); - DBufPutc(&pre_buf, ' '); - DBufFree(&buf); - if (r) return r; - r=ParseToken(p, &buf); - DBufPuts(&pre_buf, DBufValue(&buf)); - DBufPutc(&pre_buf, ' '); - DBufFree(&buf); - if (r) return r; - r=ParseToken(p, &buf); - DBufPuts(&pre_buf, DBufValue(&buf)); - DBufPutc(&pre_buf, ' '); - DBufFree(&buf); - if (r) return r; - if (!PsCal && !DoSimpleCalendar) { - DBufFree(&pre_buf); + if (!strcmp(trig.passthru, "COLOR")) { + /* Strip off the three color numbers */ + DBufFree(&buf); + r=ParseToken(p, &buf); + DBufPuts(&pre_buf, DBufValue(&buf)); + DBufPutc(&pre_buf, ' '); + DBufFree(&buf); + if (r) return r; + r=ParseToken(p, &buf); + DBufPuts(&pre_buf, DBufValue(&buf)); + DBufPutc(&pre_buf, ' '); + DBufFree(&buf); + if (r) return r; + r=ParseToken(p, &buf); + DBufPuts(&pre_buf, DBufValue(&buf)); + DBufPutc(&pre_buf, ' '); + DBufFree(&buf); + if (r) return r; + if (!PsCal && !DoSimpleCalendar) { + DBufFree(&pre_buf); + } } } diff --git a/tests/test.cmp b/tests/test.cmp index 06d14b6e..17948357 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -844,6 +844,7 @@ September 30 2007/08/02 COLOR * * * 255 0 0 Red Thursday 2007/08/02 * * * * 1 NonOmit-1 2007/08/02 * * * * 1 NonOmit-2 +2007/08/03 SHADE * * * 0 255 0 2007/08/03 * * * * 2 NonOmit-1 2007/08/03 * * * * 2 NonOmit-2 2007/08/04 * * * * 3 NonOmit-1 @@ -860,10 +861,12 @@ September 30 2007/08/09 COLOR * * * 255 0 0 Red Thursday 2007/08/09 * * * * 8 NonOmit-1 2007/08/09 * * * * 6 NonOmit-2 +2007/08/10 SHADE * * * 0 255 0 2007/08/10 * * * * 9 NonOmit-1 2007/08/10 * * * * 7 NonOmit-2 2007/08/11 * * * * 10 NonOmit-1 2007/08/11 * * * * 8 NonOmit-2 +2007/08/12 MOON * * * 0 2007/08/12 * * * * 11 NonOmit-1 2007/08/12 * * * * 8 NonOmit-2 2007/08/13 * * * * 12 NonOmit-1 @@ -876,6 +879,7 @@ September 30 2007/08/16 COLOR * * * 255 0 0 Red Thursday 2007/08/16 * * * * 14 NonOmit-1 2007/08/16 * * * * 10 NonOmit-2 +2007/08/17 SHADE * * * 0 255 0 2007/08/17 * * * * 15 NonOmit-1 2007/08/17 * * * * 11 NonOmit-2 2007/08/18 * * * * 16 NonOmit-1 @@ -892,6 +896,7 @@ September 30 2007/08/23 COLOR * * * 255 0 0 Red Thursday 2007/08/23 * * * * 21 NonOmit-1 2007/08/23 * * * * 15 NonOmit-2 +2007/08/24 SHADE * * * 0 255 0 2007/08/24 * * * * 22 NonOmit-1 2007/08/24 * * * * 16 NonOmit-2 2007/08/25 * * * * 23 NonOmit-1 @@ -908,6 +913,7 @@ September 30 2007/08/30 COLOR * * * 255 0 0 Red Thursday 2007/08/30 * * * * 28 NonOmit-1 2007/08/30 * * * * 20 NonOmit-2 +2007/08/31 SHADE * * * 0 255 0 2007/08/31 * * * * 29 NonOmit-1 2007/08/31 * * * * 21 NonOmit-2 # rem2ps end diff --git a/tests/test2.rem b/tests/test2.rem index 45ebc845..6aa2ff5f 100644 --- a/tests/test2.rem +++ b/tests/test2.rem @@ -17,6 +17,12 @@ omit 14 aug REM WED +2 SPECIAL COLOR 0 0 255 %"Blue Wednesday%" is %b REM THU SPECIAL COLOR 255 0 0 Red Thursday +# Test SPECIAL SHADE +REM FRI SPECIAL SHADE 0 255 0 + +# Test SPECIAL MOON +REM 12 AUG SPECIAL MOON 0 + # Test nonomitted REM MSG [nonomitted('2007-08-01', today())] NonOmit-1 REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2