[dev] cal -5 and -7

From: Antoni V. <antoniv_AT_gmx.com>
Date: Sun, 15 Jan 2017 23:55:53 +0100

I wanted to add -5 and -7 to cal and I did.
And it works.
But it looks bad.
Can anyone think of better implementation?
Thanks.

+ case '5':
+ nmons = 5;
+ if (--month == 0) {
+ month = 12;
+ year--;
+ }
+ if (--month == -1) {
+ month = 11;
+ year--;
+ }
+ break;
+ case '7':
+ nmons = 7;
+ if (--month == 0) {
+ month = 12;
+ year--;
+ }
+ if (--month == -1) {
+ month = 11;
+ year--;
+ }
+ if (--month == -2) {
+ month = 10;
+ year--;
+ }
+ break;
Received on Sun Jan 15 2017 - 23:55:53 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 16 2017 - 00:00:31 CET