Fix regression that broke non-COLOR specials.

This commit is contained in:
David F. Skoll
2007-08-30 23:23:45 -04:00
parent b20578f24f
commit fed3cad3b8
4 changed files with 38 additions and 19 deletions

View File

@@ -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

View File

@@ -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);
}
}
}

View File

@@ -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

View File

@@ -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