[comp.sources.bugs] Options bug-fix in Nethack

creps@silver.bacs.indiana.edu (09/09/87)

/* Written  7:02 pm  Sep  8, 1987 by creps@silver.UUCP in silver:rec.games.hack */
/* ---------- "Options bug-fix in Nethack" ---------- */
   I few days ago I mentioned a bug in Nethack when you type "O help."
I have found the cause of this, and have fixed it. The problem was that
there was a pline() expecting four actual parameters after the first
parameter ("%s%s%s%s"). Well, one of these was a help line on the DOGMOVE
option, and was put into an #ifdef DOGNAME "________" #endif construct.
If DOGMOVE was not defined it omitted this parameter, leaving only three.
With only three parameters, the call to pline bombed out. My fix is to
add an #else clause to the construct, containing a null string ("").
This fixed the problem on my system.
   This does, however, bring up another problem: I have DOGNAME defined
in my config.h file, but evidently the compiler does not know this when
it gets to this section of code. I've also not been able to get the DOGNAME
option to work. Any ideas why DOGNAME isn't getting defined when I think
it is?
   Here is the diff file for options.c:
-	-	-	-	-	-	-	-	-
Steve Creps on the VAX 8650 running Ultrix 1.2 at Indiana University.
	creps@silver.bacs.indiana.edu
Josey: "It seems like whenever I get to likin' somebody, they ain't
	around much longer."
Chief: "I noticed when you get to not likin' somebody, they ain't around
	much longer, either."

*** options.c.old	Tue Sep  8 18:48:49 1987
--- options.c	Tue Sep  8 18:41:16 1987
***************
*** 362,367
  "The compound options are name, as in OPTIONS=name:Merlin-W,",
  #ifdef DOGNAME
  " dogname, which gives the name of your (first) dog (e.g. dogname:Rover)",
  #endif /* DOGNAME */
  #ifdef SORTING
  " packorder, which lists the order that items should appear in your pack",

--- 362,369 -----
  "The compound options are name, as in OPTIONS=name:Merlin-W,",
  #ifdef DOGNAME
  " dogname, which gives the name of your (first) dog (e.g. dogname:Rover)",
+ #else
+ "",
  #endif /* DOGNAME */
  #ifdef SORTING
  " packorder, which lists the order that items should appear in your pack",
/* End of text from silver:rec.games.hack */