aka the "Input Preprocessor": it's been a source for multiple
security bugs in the past as everything has to deal with handling
arbitrary filenames and generally resulted in multiple TOCTOU issues.
The base system never included a default LESSOPEN setting like some
Linux distributions did, but it's a suds-filled sink full of knives
to try to use safely.
ok tb@ deraadt@ millert@
ligatures: it was incomplete (only for the Arabic script and only
for the single ligature LAM WITH ALEF) and it was implemented in a
way that is unsustainable (with a static table inside less).
If we ever want ligature support, we are better off making a fresh
start. However, for languages like Arabic and Persian, even that
wouldn't really be useful without having bidirectional support first.
OK millert@
(and also considering comments from Mohammadreza Abdollahzadeh,
Evan Silberman, and benno@)
decoding a UTF-8 multibyte character to the left of a given byte -
is already needed at three places in line.c and will also be needed
for cleanup work in cmdbuf.c in the future.
OK millert@
Employ the usual form of an mbtowc(3) loop, eliminating two calls
to the bad function step_char() and reducing the number of nested
loops by one. This also removes the last caller of the bad function
binary_char(), which is consequently deleted.
While here, count ASCII C0 non-whitespace control characters as
binary (except backspace and, with -R only, escape).
OK millert@
a call to the flawed function step_char(-1), using the standard
function mbtowc(3) instead.
Merge in in_ansi_esc_seq(), simplifying the code, and make the
related functions is_ansi_end() and is_ascii_char() static because
they are used in line.c only.
OK nicm@, and no opposition when shown on tech@
use this from quit() to stop less blowing up the stack looping through
quit()/flush() if stderr is closed (for example "less /missing
2</dev/null"). ok millert
D'Amore at https://github.com/gdamore/less-fork. This has significantly
less portability goop, has a tidied up code style, uses terminfo instead
of termcap, and is has stricter POSIX compliance.
Many of our local changes have been accepted upstream: substantial
remaining local changes are code to read help files from /usr/share
rather than compiling them in, man page and help improvements, and some
tweaks to the default options.
Review and testing by millert, ok deraadt
o deal with HELPFILE not being defined
o add a SMALL definition to make a smaller less for the boot floppies
This still needs to be pared down a bit for the SMALL case