Subject: termcap file violates spec
To: None <current-users@NetBSD.ORG, rhialto@polder.ubc.kun.nl>
From: Olaf Seibert <rhialto@polder.ubc.kun.nl>
List: current-users
Date: 12/12/1996 12:32:34
Why does /usr/share/misc/termcap violate its format specification?
Consider this entry (one of several with this problem):

ansi|ansi/pc-term compatible with color:\
	:u6=\E[%i%d;%dR:u7=\E[6n:..u8=\E[?%[;0123456789]c:\
	:u9=\E[c:tc=klone+color:tc=klone+acs:tc=klone+sgr:tc=ansi-m:

It has more than one tc= entry, or more specifically, at least one tc=
entry is not the last one. This violates the documentation and the way
it has always been:

TERMCAP(5)                NetBSD Programmer's Manual                TERMCAP(5)

   Similar Terminals
     If there are two very similar terminals, one can be defined as being just
     like the other with certain exceptions.  The string capability tc can be
     given with the name of the similar terminal.  This capability must be
                                                   ^^^^^^^^^^^^^^^^^^^^^^^
     last, and the combined length of the entries must not exceed 1024.  The
     ^^^^

I have seen some programs break due to this: nn 6.5.0 (compiled for
NetBSD 1.0), when TERM=ansi, complains "TERMCAP entry for ansi has no
'cm' capability". AFAIK, nn just uses standard termcap library functions
to access the termcap database. The same happens with lynx 2.6 (for
1.0). The same happens with screen-3.7.2 compiled for 1.2, and I know
for certain that it just uses standard tgetent() calls.

/usr/local/bin/nn:
	-ltermlib.0 => /usr/lib/libtermlib.so.0.0 (0x1004e000)
	-lc.12 => /usr/lib/libc.so.12.5 (0x10050000)
/usr/local/bin/lynx:
	-lcurses.2 => /usr/lib/libcurses.so.2.1 (0x1008d000)
	-ltermcap.0 => /usr/lib/libtermcap.so.0.0 (0x10098000)
	-lc.12 => /usr/lib/libc.so.12.5 (0x1009a000)
/usr/local/bin/screen-3.7.2:
	-ltermcap.0 => /usr/lib/libtermcap.so.0.0 (0x10040000)
	-lutil.3 => /usr/lib/libutil.so.3.2 (0x10042000)
	-lcrypt.0 => /usr/lib/libcrypt.so.0.0 (0x10045000)
	-lc.12 => /usr/lib/libc.so.12.5 (0x1004a000)

-r--r--r--  2 bin  bin  3750 Sep 15 16:28 /usr/lib/libtermcap.a
-r--r--r--  2 bin  bin  8499 Sep 15 16:28 /usr/lib/libtermcap.so.0.0
-r--r--r--  2 bin  bin  4354 Sep 15 16:28 /usr/lib/libtermcap_p.a
-r--r--r--  1 bin  bin  4408 Sep 15 16:28 /usr/lib/libtermcap_pic.a
-r--r--r--  2 bin  bin  3750 Sep 15 16:28 /usr/lib/libtermlib.a
-r--r--r--  2 bin  bin  8499 Sep 15 16:28 /usr/lib/libtermlib.so.0.0
-r--r--r--  2 bin  bin  4354 Sep 15 16:28 /usr/lib/libtermlib_p.a

-Olaf.
--
___ Olaf 'Rhialto' Seibert      D787B44DFC896063 4CBB95A5BD1DAA96 
\X/ Don't dream it, Be it               rhialto@polder.ubc.kun.nl