Path: utzoo!attcan!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!hp4nl!philmds!prle!cstw01!meulenbr From: meulenbr@cstw01.UUCP (Frans Meulenbroeks) Newsgroups: comp.os.minix Subject: commands/date.c bug + fix Message-ID: <321@cstw01.UUCP> Date: 2 Jan 89 08:57:50 GMT Reply-To: meulenbr@cst.UUCP () Organization: Centre for Software Technology, Philips Eindhoven Lines: 61 Happy New Year with much minix! As probably all people dedicated to minix have noticed there is a bug in 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. 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. 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 09:51:45 1989 sed 's/^X//' << \SHAR_EOF > date.cdiff X*** date.c.orig Mon Jan 2 09:46:53 1989 X--- date.c Mon Jan 2 09:47:48 1989 X*************** long t X*** 65,72 **** 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 if (((tm.year + 2) % 4) == 0) X days_per_month[1]++; X--- 65,74 ---- X while (t >= s_p_year) { X if (((tm.year + 2) % 4) == 0) X t -= s_p_day; X! if (t >= s_p_year) { X! tm.year += 1; X! t -= s_p_year; X! } X } X if (((tm.year + 2) % 4) == 0) X days_per_month[1]++; 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)