greagle@530GA ~/a/sbase> ./cal -3 November 2014 December 2014 January 2015 Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 1 2 3 4 5 6 1 2 3 4 2 3 4 5 6 7 8 7 8 9 10 11 12 13 5 6 7 8 9 10 11 9 10 11 12 13 14 15 14 15 16 17 18 19 20 12 13 14 15 16 17 18 16 17 18 19 20 21 22 21 22 23 24 25 26 27 19 20 21 22 23 24 25 23 24 25 26 27 28 29 28 29 30 31 26 27 28 29 30 31 30 greagle@530GA ~/a/sbase> ./cal 1 2015 January 2015 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
January 2015 is supposed to start on a Thursday. Note the first result is incorrect but the second result is correct. I wish I could provide a patch too, but I don't understand the calendar algorithm(s) used in cal.c. Incidentally, I am in the process of doing a rewrite of cal for my own education and entertainment (and maybe for submission to suckless, if it turns out well), and it does not have this problem, but, alas, it is not ready yet. -- http://www.fastmail.com - IMAP accessible web-mail