[comp.sources.games.bugs] "puzzle" fix for SCO xenix!

libove@andrew.cmu.edu (07/04/88)

Well, after having the sources to the game "puzzle" lying around my Xenix
system for quite some time, and not figuring out how to get it working, I
posted a request for help recently, and got back one response, and it held
the right answer!

It turns out that "puzzle" must be compiled in large model (-Ml) because
of its dataspace needs, but that it calls getenv() without previously
defining its return type of (char *)... so in large model it assumes a
cast of an integer return from getenv() to a long pointer to (char *), and
the resulting executable core dumps before getting anywhere.

The solution is of course to put "extern char *getenv()" up at the top
of the puzzle.c source file.

One other thought however. If you run puzzle and get a cryptic "terminal
isn't right" error, it is because your terminal lacks some attribute,
probably it has only HI/HE or only SO/SE and not both (that was my problem).

Since SCO Xenix's ANSI default terminal type does indeed lack HI/HE, I 
simply added an (pseudocode) "if HI/HE not found, use US/UE instead"
(that is, use underscores instead).

I hope this helps those Xenix sites that wanted Puzzle - I've played it
briefly and been completely stopped by it :-)
-- 
Jay Libove               Internet: libove@cs.cmu.edu libove@andrew.cmu.edu
5313 Ellsworth Avenue              formtek!ditka!libove!libove@pt.cs.cmu.edu
Pittsburgh, PA 15232         UUCP: cmucspt!formtek!ditka!libove!libove
(412) 621-9649                     cadre!pitt!darth!libove!libove