Subject: Re: bin/2417: snake won't run (coredumps) due to terminal problem (?)
To: None <email@example.com>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
Date: 05/16/1996 06:55:09
> When running the game "snake" (/usr/games/snake), it coredumps
> immediately on startup. I traced it down to move.c line 646, which
> does a strlen(BS), where BS is NULL. If I change this to
> if (BS != NULL)
> BSlength = strlen(BS);
> BSlength = 0;
This is surely not the right fix. If the terminal has neither :bc=:
nor :bs: (see above, where BS is set), then it can't backspace at all.
Snake is apparently not prepared to deal with terminals that simply
cannot backspace; your "fix" makes it use a zero-length string as the
backspace string, which naturally doesn't work right.
> This happens with both vt220 and vt100 termcaps;
Indeed, I find that the NetBSD termcap file spsecifies neither bc nor
bs for vt100 and vt220. This is a serious bug in the termcap file;
both those terminals should have :bs:.
If you want to make it work, set BSlength to something really huge,
like 1000, in the BS==NULL case; then the code will think the BS string
is so expensive that it will always prefer to use cursor motion.