diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c index 5b1cc157fb5e..3217676b9771 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -1,4 +1,4 @@ -/* $NetBSD: parsetime.c,v 1.19 2009/01/18 01:02:31 lukem Exp $ */ +/* $NetBSD: parsetime.c,v 1.20 2019/02/16 17:56:57 kre Exp $ */ /* * parsetime.c - parse time for at(1) @@ -160,7 +160,7 @@ static bool sc_tokplur; /* scanner - is token plural? */ #if 0 static char rcsid[] = "$OpenBSD: parsetime.c,v 1.4 1997/03/01 23:40:10 millert Exp $"; #else -__RCSID("$NetBSD: parsetime.c,v 1.19 2009/01/18 01:02:31 lukem Exp $"); +__RCSID("$NetBSD: parsetime.c,v 1.20 2019/02/16 17:56:57 kre Exp $"); #endif #endif @@ -405,7 +405,8 @@ tod(struct tm *tm) * if we've gone past that time - but if we're specifying a time plus * a relative offset, it's okay to bump things */ - if ((sc_tokid == TOKEOF || sc_tokid == PLUS) && tm->tm_hour > hour) { + if ((sc_tokid == TOKEOF || sc_tokid == PLUS) && (tm->tm_hour > hour || + (tm->tm_hour == hour && tm->tm_min > minute))) { tm->tm_mday++; tm->tm_wday++; }