"tabs" and "tput" assume TERM is set
Tony L. Hansen
hansen at pegasus.UUCP
Sat Jul 27 23:52:15 AEST 1985
In article <2484 at sun.uucp> guy at sun.uucp (Guy Harris) writes:
>Both of them assume, at some point, that getenv("TERM") will never return a
>NULL. Regardless of whether the S5 Interface Definition says it'll always
>be set or not, it's really dumb to assume it'll never happen... (Also,
>"tput" didn't declare "getenv".)
>
Actually, both of these programs pass that work on to setupterm() to notice
that getenv() may have returned a NULL. Setupterm() then handles it
gracefully.
Agreed that getenv() should have been declared.
You did not note that the setupterm(0,...) should really have been
setupterm((char*)0,...); probably because your changes got rid of the line.
Nor did you note that tabs copies the information from the terminfo
structure into its own local buffers which are much too small for some
terminal entries. It should either declare the buffers larger, just use the
terminfo entries where appropriate, or use char pointers instead of strcpy()
into the buffer.
Tony Hansen
pegasus!hansen
More information about the Net.bugs.usg
mailing list