[Remind-Fans] Remind 03.01.03 SATISFY-related bug [Was: wyrd parse error]

Paul Pelzl pelzlpj at eecs.umich.edu
Mon Nov 5 00:27:03 EST 2007


On Sun, Nov 04, 2007 at 09:41:27PM -0500, John Shafer wrote:
> I've attached a remind file that triggers the error.  I'm sorry it isn't
> shorter, but I can't figure out what's triggering the error.  Most of
> the stuff in there is directly copied from one of the reminder files
> included with remind.

OK, this looks like a bug in Remind, new to release 03.01.03.  The
following is a stripped-down reminders file that triggers the bug when
Remind is invoked via "remind -s":

REM Thu Nov 22 SCANFROM [trigger(today()-7)] SATISFY 1
OMIT [trigger(trigdate())] MSG %"Thanksgiving%" Day
REM Aug 30 2007 *7 AT 9:30 DURATION 1:15 SKIP SATISFY [trigdate() > '2008-01-01'] MSG Class

David: This issue goes a bit beyond my comfort level in Remind's
internals, but I've attached a patch containing my best guess as to the
proper solution.

Paul


-------------- next part --------------
diff -pru remind-03.01.03/src/calendar.c remind-03.01.03-satisfy-patch/src/calendar.c
--- remind-03.01.03/src/calendar.c	2007-09-16 16:47:26.000000000 -0500
+++ remind-03.01.03-satisfy-patch/src/calendar.c	2007-11-04 23:06:28.000000000 -0600
@@ -604,6 +604,7 @@ static int DoCalRem(ParsePtr p, int col)
     if (trig.typ == SAT_TYPE) {
 	r=DoSatRemind(&trig, &tim, p);
 	if (r) return r;
+        if (!LastTrigValid) return OK;
 	r=ParseToken(p, &buf);
 	if (r) return r;
 	FindToken(DBufValue(&buf), &tok);
diff -pru remind-03.01.03/src/dorem.c remind-03.01.03-satisfy-patch/src/dorem.c
--- remind-03.01.03/src/dorem.c	2007-09-26 07:37:29.000000000 -0500
+++ remind-03.01.03-satisfy-patch/src/dorem.c	2007-11-04 23:24:06.000000000 -0600
@@ -820,9 +820,14 @@ int DoSatRemind(Trigger *trig, TimeTrig 
     while (iter++ < MaxSatIter) {
 	jul = ComputeTrigger(jul, trig, &r);
 	if (r) {
-	    if (r == E_CANT_TRIG) return OK; else return r;
+	    if (r == E_CANT_TRIG) {
+		LastTrigValid = 0;
+		return OK;
+	    }
+	    else return r;
 	}
 	if (jul == -1) {
+	    LastTrigValid = 0;
 	    return OK;
 	}
 	s = p->pos;


More information about the Remind-fans mailing list