scron

simple cron daemon
git clone git://git.2f30.org/scron.git
Log | Files | Refs | README | LICENSE

commit e5df717edacba518c22f455821da11fc9c72ff80
parent ecbc114d2f55ddfa7e5679c32ad558951990c2d3
Author: sin <sin@2f30.org>
Date:   Thu Jul 10 23:18:21 +0100

Fix */n support

Do it as early as possible and only if div > 0.

Diff by defer.

Diffstat:
crond.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/crond.c b/crond.c @@ -214,11 +214,12 @@ matchentry(struct ctabentry *cte, struct tm *tm) /* this is the match-any case, '*' */ if (matchtbl[i].f->low == -1 && matchtbl[i].f->high == -1) continue; + if (matchtbl[i].f->div > 0) + if (matchtbl[i].tm % matchtbl[i].f->div == 0) + continue; if (matchtbl[i].f->high == -1) { if (matchtbl[i].f->low == matchtbl[i].tm) continue; - else if (matchtbl[i].tm % matchtbl[i].f->div == 0) - continue; } else { if (matchtbl[i].f->low <= matchtbl[i].tm && matchtbl[i].f->high >= matchtbl[i].tm)