Path: utzoo!attcan!uunet!tektronix!tekgen!tekred!libove
From: libove@andrew.cmu.edu
Newsgroups: comp.sources.games.bugs
Subject: "puzzle" fix for SCO xenix!
Keywords: puzzle,fix,xenix,sco
Message-ID: <56@libove.UUCP>
Date: 4 Jul 88 00:01:44 GMT
Sender: billr@tekred.TEK.COM
Organization: NKJL Enterprises
Lines: 28
Status: OR



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