[comp.lang.postscript] PostScript Calendar - Correction Required

steed@techunix.BITNET (Ze'ev) (04/18/88)

os.rutgers.edu> <240@uwovax.uwo.cdn>
Reply-To: steed@techunix.UUCP (Ze'ev (Steed) Shtadler)
Organization: Technion, Israel Inst. Tech., Haifa Israel
Lines: 53
Apparently-To: post-usenet@ucbvax.berkeley.edu

In article <240@uwovax.uwo.cdn> 3021_4346@uwovax.uwo.cdn writes:
>
> With regard to the revised PostScript monthly calendar, has
> anybody noticed that it is producing incorrect calendars
> for the months of April 1988 onwards?
>
> Does anybody have the corrected version available yet?

The bug is a small one: it checks the month in a leap year to be equal
to 3 (March) instead of greater or equal (March or later).  As a result
the first day of the month of the months after March are not shifted as
it should have been.

Here is the diff for the change.  Line numbers may differ, but PScal can
also be corrected using an editor of your choice: change the "eq" to a
"ge" in the right place.

----------- text of diff follows -----------------
*** /tmp/,RCSt1007388   Mon Apr 18 13:28:51 1988
--- /tmp/,RCSt2007388   Mon Apr 18 13:28:51 1988
***************
*** 183,189 ****
        /off exch def
        1 1 month 1 sub {
                days_month exch 1 sub get
!               month 3 eq
                isleap and
                firsttime and
                {
--- 183,189 ----
        /off exch def
        1 1 month 1 sub {
                days_month exch 1 sub get
!               month 3 ge
                isleap and
                firsttime and
                {
----------- End of diff text ---------------------

                                Good Luck,
                                        Ze'ev.
----
Ze'ev Shtadler.
Computer Science Faculty,
Technion, Israel Institute of Thechnology,
Haifa Israel
Phone (work):   (+972) 4-293849

BITNET:  steed@techunix
Domain:  steed@techunix.technion.ac.il
UUCP:    ...!psuvax1!techunix.bitnet!steed
ARPANET: steed%techunix.bitnet@cunyvm.cuny.edu
CSNET:   steed%techunix.bitnet@csnet-relay.csnet

phil@osiris.UUCP (Philip Kos) (04/22/88)

In article <3789@techunix.BITNET>, steed@techunix.BITNET (Ze'ev) writes:
> In article <240@uwovax.uwo.cdn> 3021_4346@uwovax.uwo.cdn writes:
> > With regard to the revised PostScript monthly calendar, has
> > anybody noticed that it is producing incorrect calendars
> > for the months of April 1988 onwards?
> The bug is a small one: it checks the month in a leap year to be equal
> to 3 (March) instead of greater or equal (March or later).  As a result
> the first day of the month of the months after March are not shifted as
> it should have been.

Weird... I didn't notice any problem either, and after several different
people mentioned it, I figured I must be even more twisted than I thought.
But then I read on....

> Here is the diff for the change.  Line numbers may differ, but PScal can
> also be corrected using an editor of your choice: change the "eq" to a
> "ge" in the right place.

I looked at the diff, looked at my copy of pscal, looked at the diff,
scratched my head, looked at my copy of pscal, looked at the diff,
scratched my head... it appears that the reason most recipients of the
new calendar program didn't notice the problem is because it doesn't
exist in their version.  Perhaps two versions made it out on the net;
mine certainly has no test for "month 3 ge", or for "month 3 eq" for
that matter; only for "month 2 eq".

Maybe the people with the bad calendars are using the old crufty pscal?
Mine is marked "Copyright (C) 1987 by Pipeline Associates, Inc.", and
was posted around the beginning of April (it has since expired and I
have since modified my copy, so I can't dredge up the posting date).


                                                                 Phil Kos
...!decvax!decuac!\                                   Information Systems
  ...!uunet!mimsy!aplcen!osiris!phil           The Johns Hopkins Hospital
...!allegra!/                                               Baltimore, MD