Termcap question

Russ Kepler russ at bbx.UUCP
Fri Mar 9 02:40:13 AEST 1990


In article <680 at mwtech.UUCP> martin at mwtech.UUCP (Martin Weitzel) writes:
>
>(%): There is a small design flaw in termcap: The strings you
>read with "tgetstr" are stored \0-terminated, as usual in C
>and you only have the adress of the first character, so you can
>not distinguish an 'embedded' \0 from the terminating \0. Of
>course, if you are willing to write (parts of) the termcap library
>functions new, you may correct this by adding a length-count ...

Ignoring the output side (tputs) you actually can (and will) 
get nulls from tgetstr.  The strings tgetstr returns are null
terminated *but* you did provide a char ** for tgetstr's use.
The difference of the ending value and the starting value will
provide the null containing strings' length.

I had to use this for a terminal that send nulls in the function
key strings.


-- 
Russ Kepler -  Basis International
SNAILMAIL:  5901 Jefferson NE, Albuquerque, NM 87109
UUCP:       {backboneishsite}!unmvax!bbx!russ
PHONE:      505-345-5232



More information about the Comp.unix.questions mailing list