On Thu, Feb 01, 2024 at 03:13:42PM +0000, RVP wrote:
> This looks like a bug in NetBSD. Minimal reproducer:
> 
> ```
> $ cat tit
> tit|TermInfo Test,
> # if the second number is >32767, it disappears!
>         use=num, use=max,
> # putting the bigger one first makes "promotion" happen.
> #       use=max, use=num,
> 
> max|any number > INT16_MAX,
>         colors#32768,
> 
> num|any num < INT16_MAX,
>         num#111,
> 
> $ tic -x tit

This is fallout from usr.bin/tic.c:

------------------------------
revision 1.33
date: 2020-03-27 16:11:57 +0100;  author: christos;  state: Exp;  lines: +21 
-17;  commitid: 2Q6C4aNTDvrFf32C;
As described in tech-userlevel:
- Modify the writing code to only write entries in the new
  format for the terminal descriptions that require it.
- Store new format entries as <name>@v3
- Store old format entries with clamped values as <name> for
  backwards compatibility
- Lookup first <name>@v3 and then <name> if that is not found.
- Don't create terminfo2 anymore; old programs keep working with
  clamped entries, and new programs be able to use the wide
  fields with using the original db file.
------------------------------

especially this part of process_entry:

        if (tic->rtype == TERMINFO_RTYPE)
                return process_entry(&sbuf, flags | TIC_COMPAT_V1);


but I don't understand how it is supposed to work.

Martin

Reply via email to