Module Name:    src
Committed By:   kre
Date:           Sat Feb 16 17:56:57 UTC 2019

Modified Files:
        src/usr.bin/at: parsetime.c

Log Message:
PR bin/53986 from Christian Weisgerber

Skip forward to tomorrow to run a command earlier in the current
hour than now (as well as during an earlier hour of the day).


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/at/parsetime.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/at/parsetime.c
diff -u src/usr.bin/at/parsetime.c:1.19 src/usr.bin/at/parsetime.c:1.20
--- src/usr.bin/at/parsetime.c:1.19	Sun Jan 18 01:02:31 2009
+++ src/usr.bin/at/parsetime.c	Sat Feb 16 17:56:57 2019
@@ -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 
 #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++;
 	}

Reply via email to