Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pegasus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!pegasus!hansen From: hansen@pegasus.UUCP (Tony L. Hansen) Newsgroups: net.bugs.usg Subject: Re: "tabs" and "tput" assume TERM is set Message-ID: <2455@pegasus.UUCP> Date: Sat, 27-Jul-85 09:52:15 EDT Article-I.D.: pegasus.2455 Posted: Sat Jul 27 09:52:15 1985 Date-Received: Mon, 29-Jul-85 06:08:45 EDT References: <2484@sun.uucp> Reply-To: hansen@pegasus.UUCP (60545451-Tony L. Hansen;LZ 3B-315;6243) Distribution: net Organization: AT&T Information Systems, Lincroft NJ Lines: 25 Summary: setupterm() takes care of it In article <2484@sun.uucp> guy@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