bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -2 in numeric and string capabilities


From: Florian Weimer
Subject: Re: -2 in numeric and string capabilities
Date: Tue, 21 Jul 2020 07:11:10 +0200

* Thomas Dickey:

> On Mon, Jul 20, 2020 at 08:54:00PM +0200, Florian Weimer wrote:
>> term(5) says this:
>> 
>> | Short integers are stored in two 8-bit bytes.  The first byte contains
>> | the least significant 8 bits of the value, and the second byte
>> | contains the most significant 8 bits.  (Thus, the value represented is
>> | 256*second+first.)  The value -1 is represented by the two bytes 0377,
>> | 0377; other negative values are illegal. […]
>> |
>> | The numbers section is similar to the flags section.  Each capability
>> | takes up two bytes, and is stored as a little-endian short integer.
>> | If the value represented is -1, the capability is taken to be
>> | missing.
>> |
>> | The strings section is also similar.  Each capability is stored as a
>> | short integer, in the format above.  A value of -1 means the
>> | capability is missing.  Otherwise, the value is taken as an offset
>> | from the beginning of the string table. […]
>> 
>> But the value -2 occurs in practice, too.
>
> in a terminal description?

It does.

> perhaps not - tic won't accept a negative value.
> ...if it did, that would be a bug
> ...of course, someone could put the bits together without the tool :-)

I see it in Debian's ncurses-term package (version
6.1+20181013-2+deb10u2).  It occurs for the numeric capability 15
(no_color_video, I think) in the xterm-xf86-v32 terminal description,
or for the string capability 52 (insert_character) in the xterm-nic
terminal description file.  I see similar problems in Fedora's Eterm
description file (package version ncurses-base-6.1-15.20191109.fc32),
so it's not caused by a Debian-specific patch.

I haven't checked whether this still happens with current upstream
sources.

I think canceled capabilities need to be flagged in the compiled
description file somehow (and differently from absent capabilities) if
terminal descriptions are to be compiled separately.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]