[net.sources.bugs] vtrek

cwj@csadfa.oz (10/22/85)

howard@cyb.eng.UUCP
suggests using "tputs(tgoto...))" rather than "fputs(tgoto...)"
in vtrek.
This is necessary to deal with padding correctly,
BUT a vt100 still gets 'J's and no proper cursor positioning,
as several people have reported.

Reason: insufficient buffer space allocated to the termcap "cl" string
(which therefore overwrites "cm" - with a 'J') when calling "tgetstr" in
termio.c:terminit function.

Minimal Fix:
in file termio.c, change declaration "char cl[5];" to "char cl[10];".

(The better fix is to use the "char **" parameter to "tgetent" to assist you
in allocating space to each entry, as much as it actually needs out of a larger
array, along the lines of

	char * cl, *cm;    /* terminal control strings */
	char tentries[100];	/* storage area for terminal controls */
	...
	p = tentries;

	cl = p;
	tgetstr("cl", &p);
	cm = p;
	tgetstr("cm", &p);

-- ---------- --
Chris Johnson			 ISD:	+61 62 68 8170
Dept. Computer Science		 STD:	(062) 68 8170
University College	      ACSNET:	cwj@csadfa.oz
Uni. New South Wales		UUCP:	...!seismo!munnari!csadfa.oz!cwj    or
Aust. Defence Force Academy	...!{decvax,pesnta,vax135}!mulga!csadfa.oz!cwj
Canberra. ACT. 2600.		ARPA:	cwj%csadfa.oz@SEISMO.ARPA
AUSTRALIA		       CSNET:	cwj@csadfa.oz

robert@gitpyr.UUCP (Robert Viduya) (10/23/85)

The real solution to fixing vtrek is to make it use curses.  I've got a fixed
version that runs perfectly well on an AT&T 3B2 running SysV with curses. If
I get enough requests, I'll post it.  BSD folks will probably have to change
a couple of lines in it (cbreak/crmode and incompatibilities like that), but
that shouldn't be real difficult.

It works faster too, if you're on a low-speed line.

				robert
-- 
Robert Viduya							01111000
Office of Computing Services
Georgia Institute of Technology

UUCP:   {akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert
        {rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert
BITNET:	CC100RV @ GITVM1

dta@cpsc53.UUCP (Doug Anderson) (10/24/85)

> 
> The real solution to fixing vtrek is to make it use curses.  I've got a fixed
> version that runs perfectly well on an AT&T 3B2 running SysV with curses. If
                                                                            ^^
> I get enough requests, I'll post it.  
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> 				robert
> -- 
> Robert Viduya							01111000
> Office of Computing Services
> Georgia Institute of Technology
> 

	Consider this one of mayn requests.  I gave up on vtrek on 
	my 3B2 and would like a copy of the "fixed" version.

			Thanks

			Doug Anderson