Blindly scanning the capabilities for # and checking that the following
number is bigger than a short isn't reliable because this could be a
string value:
SomeString#1234
Instead, if we process the numeric as normal and if it's value is too big
for v1 then promote the record to v3.
- 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.
result type of strerror() (and strerror_l()). While that once should
really have been present, when strerror() was invented, there was no
"const" qualifier in C to apply, and now the way the code is writtem
(really needs to be because of NLS support) the const is no longer
really appropriate.
Applications still shouldn't attempt to modify the result however.
While here also document (but comment it out since it isn't
available - yet) strerror_lr(). To include that, simply
uncomment the relevant lines, and (twice I think) s/returns/return/
on lines just after currently commented out lines (that is, it
currently says, "A returns" after the comments are returned, we
need it to be "A and B return" - the "and B" appears when the comment
markers are removed, removing the 's' from returns must be done manually.
In addition to adding strerror_l() some additional enhancements were
made to the general strerror() doc.
The restriction that a fd passed to fdatasync(2) must be writable was
added in 2003 in order to comply with POSIX. Since then, POSIX has
removed that requirement, and POSIX-valid programs have been therefore
encountering errors on NetBSD.
Patch by Paul Ripke after discussion on netbsd-users. Issue
discovered with pkgsrc/databases/mongodb3 as used by pkgsrc/net/unifi.
unsigned equivalent of -1.
While here, guarantee, even when !NLS, that nothing here (not even
snprintf deciding to complain about EILSEQ or something) can ever
alter errno (ie: always save and restore it, not only in the NLS case).
The functions here must never alter errno, whatever happens.
has failed, in the hope that some other thread has free'd some memory,
but we want to bound the number of attempts, it helps if we actually
count them - otherwise we never get nearer to the limit.
In practice, malloc() for a reasonable application on a modern system
almost never fails, so the code containing this bug has probably never
been, and never will be, executed, but just in case, someday.
For this, it isn't clear if the intent was to have 10 retries (ie: 11
attempts) or 10 tries, but as the code said "retries > 10", I am
assuming the former (not that it matters, if the malloc() has failed
10 times in a row, with 10 second pauses between, the chances of an
11th succeeding aren't great).
No mouse support actually included.
But that doesn't matter because most terms don't actually support a mouse.
We should look into hooking these into wsmouse(4) and xterm mouse
in the future.
Compatable with nCurses mouse API version 2.
POSIX mandates implementations must support upto a short but may exceed it.
When NetBSD terminfo was implemented, no terminfo description used over
a short, but because ncurses has supported ints for some time, some now do.
Infact, such a terminfo description was imported where colour pairs for
screen-256color went up to 65536 which exposed a bug in the existing
implementation where it set to zero. Because the number might mean
something more than a range, we need to be able to store it accurately.
This requires a version bump because whilst the API hasn't changed thanks
to C int promotion, the ABI has. Also the underlying database structure
has changed as well - we now store the numeric paramter inside a uint32_t
field rather than a uint16_t one.
Whilst this change can still read the old style database, the old one
cannot read the new one and thus we now maintain the database as
terminfo2.cdb, leaving the old library and database alone so old programs
still work fine.
libcurses, libfrom, libmenu and libpanel have also been bumped to
accomoate this change.