On Mon, Dec 15, 2014 at 11:53:26AM -0500, random...@fastmail.us wrote:
> On Mon, Dec 15, 2014, at 11:47, Greg Reagle wrote:
> > January 2015 is supposed to start on a Thursday.  
> 
> January 2014 started on a Wednesday - maybe it's worth investigating
> whether cal -3 that spans two years isn't using the correct year for
> some of the months.
> 

Found it!
>From 2476d80e7f4854382943368299b4e06a0c53db8c Mon Sep 17 00:00:00 2001
From: Markus Wichmann <nullp...@gmx.net>
Date: Mon, 15 Dec 2014 20:42:12 +0100
Subject: [PATCH] Fix problem with multi month display spanning a year.

---
 cal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cal.c b/cal.c
index 8b5244c..dca2313 100644
--- a/cal.c
+++ b/cal.c
@@ -59,7 +59,7 @@ drawcal(int year, int month, int day, int ncols, int nmons, int fday)
 				yoff = year + moff / 12;
 
 				ndays = mdays[cur] + ((cur == 1) && isleap(yoff));
-				day1 = dayofweek(year, cur, 1, fday);
+				day1 = dayofweek(yoff, cur, 1, fday);
 
 				for (d = 0; d < 7; d++) {
 					if ((r || d >= day1) && count[i] <= ndays)
-- 
2.1.3

Reply via email to