=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cal/cal.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/cal/cal.c 1997/01/15 23:42:15 1.4 --- src/usr.bin/cal/cal.c 1998/03/30 06:59:23 1.5 *************** *** 1,4 **** ! /* $OpenBSD: cal.c,v 1.4 1997/01/15 23:42:15 millert Exp $ */ /* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: cal.c,v 1.5 1998/03/30 06:59:23 deraadt Exp $ */ /* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */ /* *************** *** 47,53 **** #if 0 static char sccsid[] = "@(#)cal.c 8.4 (Berkeley) 4/2/94"; #else ! static char rcsid[] = "$OpenBSD: cal.c,v 1.4 1997/01/15 23:42:15 millert Exp $"; #endif #endif /* not lint */ --- 47,53 ---- #if 0 static char sccsid[] = "@(#)cal.c 8.4 (Berkeley) 4/2/94"; #else ! static char rcsid[] = "$OpenBSD: cal.c,v 1.5 1998/03/30 06:59:23 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 59,64 **** --- 59,65 ---- #include #include #include + #include #include #define THURSDAY 4 /* for reformation */ *************** *** 109,115 **** /* leap year -- account for gregorian reformation in 1752 */ #define leap_year(yr) \ ((yr) <= 1752 ? !((yr) % 4) : \ ! !((yr) % 4) && ((yr) % 100) || !((yr) % 400)) /* number of centuries since 1700, not inclusive */ #define centuries_since_1700(yr) \ --- 110,116 ---- /* leap year -- account for gregorian reformation in 1752 */ #define leap_year(yr) \ ((yr) <= 1752 ? !((yr) % 4) : \ ! (!((yr) % 4) && ((yr) % 100)) || !((yr) % 400)) /* number of centuries since 1700, not inclusive */ #define centuries_since_1700(yr) \ *************** *** 174,180 **** case 0: (void)time(&now); local_time = localtime(&now); ! year = local_time->tm_year + 1900; if (!yflag) month = local_time->tm_mon + 1; break; --- 175,181 ---- case 0: (void)time(&now); local_time = localtime(&now); ! year = local_time->tm_year + TM_YEAR_BASE; if (!yflag) month = local_time->tm_mon + 1; break; *************** *** 376,382 **** return; } if (julian) { ! if (val = day / 100) { day %= 100; *p++ = val + '0'; display = 1; --- 377,384 ---- return; } if (julian) { ! val = day / 100; ! if (val) { day %= 100; *p++ = val + '0'; display = 1;