Branch: Tag:

2007-01-02

2007-01-02 17:30:06 by Martin Nilsson <mani@lysator.liu.se>

Fix for calendar events.

Rev: lib/modules/Calendar.pmod/Events.pmod:1.16
Rev: lib/modules/Calendar.pmod/testsuite.in:1.13

67:       case "WDRel":    // WDRel May Fri 1st +  days=1;    if (sscanf(rule,    "WDRel%*[ \t]%s%*[ \t]%s%*[ \t]%d%*[a-z]%*[ \t]%d days", -  mn,wd,n,days)>=5 && +  mn,wd,n,days)>=7 &&    month2n[mn] && wd2n[wd] && n>0)    {    Event.Event e=
79:    return e;    }    // WDRel May Fri last +  days=1;    if (sscanf(rule,    "WDRel%*[ \t]%s%*[ \t]%s%*[ \t]%s%*[ \t]%d days", -  mn,wd,a,days)>=5 && a=="last" && +  mn,wd,a,days)>=6 && a=="last" &&    (m=month2n[mn]) && wd2n[wd])    {    m=(m%12)+1;
92:    return e;    }    // WDRel May 17 Fri +17 excl -  days=a=0; +  a=0; +  days=1;    if (sscanf(rule,    "WDRel%*[ \t]%[A-z]%*[ \t]%d%*[ \t]%s%*[ \t]"    "%d%*[ \t]%[a-z]%*[ \t]%d days", -  mn,md,wd,n,a,days)>=9 && a && a!="" && +  mn,md,wd,n,a,days)>=10 && a && a!="" &&    (m=month2n[mn]) && wd2n[wd])    {    if (!(<"incl","excl">)[a])
111:    return e;    }    // WDRel May 17 Fri +17 +  days=1;    if (sscanf(rule,    "WDRel%*[ \t]%[A-z]%*[ \t]%d%*[ \t]%[^ \t]%*[ \t]"    "%d%*[ \t]%d days", -  mn,md,wd,n,days)>=7 && +  mn,md,wd,n,days)>=8 &&    (m=month2n[mn]) && wd2n[wd])    {    m=(m%12)+1;