🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #878

Re: termcap.c for nethack

#878
From: Simon Brown
Date: Sun, 09 Aug 1987 10:02
31 lines
2042 bytes
In article <144@auscso.UUCP> knutson6@auscso.UUCP (John Knutson) writes:
>I was looking through termcap.c to see if I could figure out what all the
>garbage was when something was thrown, and I came up with this:
>	if(!flags.nonull)
>		tputs("50", 1, xputc);
>
>		/* cbosgd!cbcephus!pds for SYS V R2 */
>		/* is this terminfo, or what? */
>		/* tputs("$<50>", 1, xputc); */
>Looking in the man page for term, it says that the $<50> is padding
>information.  But, it still comes out with $<1> on the vt100 doing an
>inventory.  Could this be because you MUST have two digits?
>Inquiring minds want to know....

No, this is because of the gross way that highlighting is done for the
inventory - it does a (approximately)
	sprintf(str, "%s%s%s", HI, message, HE)
(where HI, HE are the highlight-start, highlight-end strings), and
then prints it out directly - doesn't use tputs! No wonder the $<number>
happens if you have an output-delay for highlighting (as the vt100 does)!
This must happen even using termcaps.

I've fixed it here, but in a really gross way - so I won't post it.

-- 
----------------------------------
| Simon Brown                    | UUCP:  seismo!mcvax!ukc!its63b!simon
| Department of Computer Science | JANET: simon@uk.ac.ed.its63b
| University of Edinburgh,       | ARPA:  simon%its63b.ed.ac.uk@cs.ucl.ac.uk
| Scotland, UK.                  |
----------------------------------     "Life's like that, you know"
Technical Details
Message-ID: <568@its63b.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!mcvax!ukc!its63b!xsimon
References: <144@auscso.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!mcvax!ukc!its63b!xsimon
From: xsimon@its63b.ed.ac.uk (Simon Brown)
Newsgroups: comp.sources.bugs
Subject: Re: termcap.c for nethack
Message-ID: <568@its63b.ed.ac.uk>
Date: Sun, 9-Aug-87 06:02:59 EDT
Article-I.D.: its63b.568
Posted: Sun Aug  9 06:02:59 1987
Date-Received: Wed, 12-Aug-87 04:54:18 EDT
References: <144@auscso.UUCP>
Reply-To: xsimon@its63b.ed.ac.uk (Simon Brown)
Distribution: world
Organization: Computer Science Department, Edinburgh University
Lines: 31