Path: utzoo!attcan!uunet!mcvax!hp4nl!philmds!prle!cst!meulenbr From: meulenbr@cst.UUCP (Frans Meulenbroeks) Newsgroups: comp.os.minix Subject: Re: commands/date.c bug + fix Message-ID: <324@cst.UUCP> Date: 2 Jan 89 18:37:52 GMT References: <321@cstw01.UUCP> Reply-To: meulenbr@cst.UUCP (Frans Meulenbroeks) Organization: Centre for Software Technology, Philips Eindhoven Lines: 75 Oops I goofed. As I said I sent an untested shar. Well I learned to do this never again. I've canceled the original article. Here is it again but now with a proper and tested fix. Sorry, Frans. >Happy New Year with much minix! > >As probably all people dedicated to minix have noticed there is a bug in meant was: addicted >the date program from minix (at least in the ST version, but I think >that it appears in the PC version as well). > >The problem is that date does not work properly on 12/31 on leap years. >(like 12/31/88). This is due to a bug in the cv_time module. >The (untested) shar at the end cures this problem. now it is tested, and it works > >I got also a bug report that cc would not work properly on this day. >I have not been able to verify this. The person who told me about this, >said that it happened on an ST. I'm unsure if this happens on a PC as >well. I could repeat this. /usr/lib/cem crashes with signal 11. This only happens on 12/31 on leap years. No explanation. No fix, since I do not have source from cem. Perhaps the same problem as above. Perhaps this problem only exist in Minix/ST. > >Something unrelated: >Is someone aware of a PD SCCS/RCS clone/alternative? >Any pointers would be appreciated greatly. > >Frans (.sig at end) > # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. -----cut here-----cut here-----cut here-----cut here----- #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # date.cdiff # This archive created: Mon Jan 2 19:28:48 1989 sed 's/^X//' << \SHAR_EOF > date.cdiff X*** date.c.orig Tue Sep 6 21:30:13 1988 X--- date.c Sat Dec 31 12:43:35 1988 X*************** X*** 63,70 **** X tm.min = 0; X tm.sec = 0; X while (t >= s_p_year) { X! if (((tm.year + 2) % 4) == 0) X! t -= s_p_day; X tm.year += 1; X t -= s_p_year; X } X--- 63,75 ---- X tm.min = 0; X tm.sec = 0; X while (t >= s_p_year) { X! if (((tm.year + 2) % 4) == 0) X! { X! if (t >= s_p_year + s_p_day) { X! t -= s_p_day; X! } X! else break; /* 12/3 in a leap year */ X! } X tm.year += 1; X t -= s_p_year; X } SHAR_EOF # End of shell archive exit 0 -- Frans Meulenbroeks (meulenbr@cst.prl.philips.nl) Centre for Software Technology ( or try: ...!mcvax!philmds!prle!cst!meulenbr)