Correct logic error in wildcard handling, which was causing the
day-of-month on normal entries to always be treated as a wildcard. Specifically, "if (x&(y|z))" is equivalent to "if ((x&y)||(x&z))", not "if ((x&y)&&(x&z))", which latter is clearly what was intended.
This commit is contained in:
parent
1823640767
commit
42ddba8762
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: calendar.c,v 1.38 2005/07/15 09:45:04 wiz Exp $ */
|
||||
/* $NetBSD: calendar.c,v 1.39 2006/03/24 23:30:08 jld Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993, 1994
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)calendar.c 8.4 (Berkeley) 1/7/95";
|
||||
#endif
|
||||
__RCSID("$NetBSD: calendar.c,v 1.38 2005/07/15 09:45:04 wiz Exp $");
|
||||
__RCSID("$NetBSD: calendar.c,v 1.39 2006/03/24 23:30:08 jld Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -276,13 +276,13 @@ isnow(endp)
|
|||
}
|
||||
}
|
||||
|
||||
if (flags & (F_WILDMONTH|F_WILDDAY))
|
||||
if ((flags & F_WILDMONTH) && (flags & F_WILDDAY))
|
||||
return (1);
|
||||
|
||||
if ((flags & (F_WILDMONTH|F_ISDAY)) && (day == tp->tm_mday))
|
||||
if ((flags & F_WILDMONTH) && (flags & F_ISDAY))
|
||||
return (1);
|
||||
|
||||
if ((flags & (F_ISMONTH|F_WILDDAY)) && (month == tp->tm_mon + 1))
|
||||
if (((flags & F_ISMONTH) && (flags & F_WILDDAY)) && (month == tp->tm_mon + 1))
|
||||
return (1);
|
||||
|
||||
if (flags & F_ISDAY)
|
||||
|
|
Loading…
Reference in New Issue