Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!ncar!unmvax!bbx!russ From: russ@bbx.UUCP (Russ Kepler) Newsgroups: comp.unix.questions Subject: Re: Termcap question Keywords: termcap Message-ID: <969@bbx.UUCP> Date: 8 Mar 90 16:40:13 GMT References: <5658@star.cs.vu.nl> <671@mwtech.UUCP> <5708@star.cs.vu.nl> <680@mwtech.UUCP> Reply-To: russ@bbx.UUCP (Russ Kepler) Organization: BASIS International, Albuquerque NM Lines: 24 In article <680@mwtech.UUCP> martin@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