1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00
Commit Graph

26 Commits

Author SHA1 Message Date
guenther
c74702f8a0 Delete support for the LESSOPEN and LESSCLOSE environment variables
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@
2024-04-14 18:11:54 +00:00
schwarze
a0ba958dd2 Delete what remains of the support for combining characters into
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@)
2019-09-02 14:07:45 +00:00
schwarze
323f1f59ed New utility function mbtowc_left() because this functionality -
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@
2019-08-31 13:44:29 +00:00
schwarze
4ec154d888 trivial patch to at least make the buggy functions control_char()
and get_wchar() static for now - until they can be deleted
2019-05-15 19:36:20 +00:00
schwarze
358ad9abc0 Clean up all major UTF-8 issues in cvt.c.
This also allows to delete the buggy, now unused function put_wchar().
OK millert@
2019-05-15 18:18:08 +00:00
schwarze
3cc0e02552 Completely clean up UTF-8 handling in the file filename.c:
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@
2019-05-07 14:26:38 +00:00
schwarze
cc088c89a5 Start UTF-8 cleanup of store_char(), in particular getting rid of
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@
2019-03-01 14:31:34 +00:00
krw
745ece38b8 Split only LESS on $.
As guenther@ said "STOP SPLITTING ANYTHING BUT $LESS ON '$' !".

anton@ came up with the same diff. ok nicm@
2018-03-17 14:03:36 +00:00
mmcc
2c50122857 Remove the lintism PRINTFLIKE1, don't replace it with an attribute so we
can keep it portable.

also noticed by Michael Reed, discussed with deraadt@
2016-01-19 06:14:54 +00:00
mmcc
532ff29f12 remove needless extern keywords, a vestige of pre-ANSI C
explained by and ok millert@
2016-01-15 22:22:38 +00:00
mmcc
2a69c85b09 Remove LINUNUM, a needless alias for off_t. Also, remove a redundant
condition.

ok nicm@
2016-01-12 17:48:04 +00:00
nicm
c394714348 Missing prototype. 2015-11-23 09:38:35 +00:00
tedu
1baf26bd57 remove fancy null check function in favor of checking for null.
from Ricardo Mestre
2015-11-21 13:29:12 +00:00
nicm
a3754e8a13 Add a flag argument to flush() to stop it calling quit() on error, then
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
2015-11-13 16:48:48 +00:00
deraadt
24d73098df close_getchr() is now a noop 2015-11-09 03:09:19 +00:00
tedu
09370fe947 replace save() with estrdup() and make estrdup() exit like all the other
ecalloc, etc. functions do.
ok mmcc nicm
2015-11-07 18:07:44 +00:00
tedu
8c7533df77 time_t is not a long. remove incorrect abstraction around time().
ok nicm
2015-11-06 15:09:07 +00:00
nicm
171bb95ef0 Replace less with the cleaned-up fork of less 458 maintained by Garrett
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
2015-11-05 22:08:43 +00:00
schwarze
3f5dee8e29 Give more(1) its own help file, shorter than the one for less(1).
The helpfile itself was prepared by jmc@, the glue by me.
OK millert@ jmc@
2014-05-10 16:45:23 +00:00
shadchin
26ad794d0a Merge Less 458 plus local patches
ok guenther@, ok jmc@ for man bits
2014-04-25 13:38:21 +00:00
shadchin
168565f4ae Merge in less 444 plus local changes
ok nicm@
2011-09-16 18:12:09 +00:00
millert
f6394bfcc2 Use interruptible syscalls instead of setjmp/longjmp. This makes
less's signal handlers safe.  No one has reported problems so far...
2003-06-07 03:35:19 +00:00
millert
41a240fd15 o go back to using a help file instead of embedding it in the binary
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
2003-04-14 14:33:57 +00:00
millert
4507601837 Merge in less-381 w/ local changes and remove obsolete files. 2003-04-13 18:26:25 +00:00
niklas
d4e7c60304 $OpenBSD$ 2001-01-29 01:57:55 +00:00
etheisen
e3b7954bed Import of unmolested less-290. 1996-09-21 05:39:41 +00:00