Terminfo distribution doesn't work?

guido at boring.UUCP guido at boring.UUCP
Sat Jan 5 05:09:11 AEST 1985


In article <6273 at boring.UUCP> I asked help with running the test program,
mille, for the terminfo library.  I got two replies, telling me that the
program has a bug, namely it doesn't check the return of initscr(),
and if there is something wrong with the TERM or TERMINFO environment
variables (so the definition can't be found), initscr() fails but
mille continues as if all is well.  It then crashes when it passes
garbage to delwin().

I made the following simple fix to mille: change the initscr() call to:
	if (initscr() == ERR) {
		printf("Sorry.  No terminal description found.");
		printf("  (Check TERM or TERMINFO variables)\n");
		exit(-1);
	}

We have a compatibility problem here.  Good ol' curses' initscr()
would never fail -- if nothing was found out about the terminal,
it would assume a paper tty, and at least output some garbage.
Therefor probably every program in the world that used curses
has to be changed in this respect.

System V wizards -- is this true in the system V terminfo library
too?

	Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam
	guido at mcvax.UUCP

"Immorality may be something, but it does not take the place of virtue and
three square meals a day."



More information about the Comp.sources.bugs mailing list