about summary refs log tree commit diff
path: root/src/usr.bin/calendar/calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/calendar/calendar.c')
-rw-r--r--src/usr.bin/calendar/calendar.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/usr.bin/calendar/calendar.c b/src/usr.bin/calendar/calendar.c
index 547ba08..7886fd3 100644
--- a/src/usr.bin/calendar/calendar.c
+++ b/src/usr.bin/calendar/calendar.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: calendar.c,v 1.35 2015/12/07 18:46:35 espie Exp $	*/
+/*	$OpenBSD: calendar.c,v 1.37 2019/02/01 16:22:53 millert Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -57,9 +57,9 @@ int daynames = 0;
 time_t f_time = 0;
 int bodun_always = 0;
 
-int f_dayAfter = 0; /* days after current date */
-int f_dayBefore = 0; /* days before current date */
-int f_SetdayAfter = 0; /* calendar invoked with -A */
+int f_dayAfter = 0;	/* days after current date */
+int f_dayBefore = 0;	/* days before current date */
+int f_Setday = 0;	/* calendar invoked with -A or -B */
 
 struct specialev spev[NUMEV];
 
@@ -100,13 +100,15 @@ main(int argc, char *argv[])
 			f_dayAfter = strtonum(optarg, 0, INT_MAX, &errstr);
 			if (errstr)
 				errx(1, "-A %s: %s", optarg, errstr);
-			f_SetdayAfter = 1;
+			f_Setday = 1;
 			break;
 
 		case 'B': /* days before current date */
 			f_dayBefore = strtonum(optarg, 0, INT_MAX, &errstr);
 			if (errstr)
 				errx(1, "-B %s: %s", optarg, errstr);
+			if (f_dayBefore != 0)
+				f_Setday = 1;
 			break;
 
 		case 'w':