OpenBSD CVS

CVS log for src/usr.bin/less/main.c


[BACK] Up to [local] / src / usr.bin / less

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.40 / (download) - annotate - [select for diffs], Sun Apr 14 18:11:54 2024 UTC (4 weeks, 6 days ago) by guenther
Branch: MAIN
CVS Tags: HEAD
Changes since 1.39: +0 -4 lines
Diff to previous 1.39 (colored)

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@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Dec 26 19:16:01 2022 UTC (16 months, 3 weeks ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.38: +1 -1 lines
Diff to previous 1.38 (colored)

spelling fixes; from paul tagliamonte
amendments to his diff are noted on tech

Revision 1.38 / (download) - annotate - [select for diffs], Thu Sep 23 18:46:25 2021 UTC (2 years, 7 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.37: +1 -1 lines
Diff to previous 1.37 (colored)

Remove wpath from secure mode pledge.

Upstream removed history file support for secure mode. The history file
feature is off by default already, disallowing it altogether in secure
mode allows us to drop wpath.

Added a note about it to manual page.

ok benno, deraadt

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jun 28 05:44:09 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.36: +1 -1 lines
Diff to previous 1.36 (colored)

asprintf returns -1, not an arbitrary value < 0.  Also upon error the
(very sloppy specification) leaves an undefined value in *ret, so it is
wrong to inspect it, the error condition is enough.
discussed a little with nicm, and then much more with millert until we
were exasperated

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 17 14:03:36 2018 UTC (6 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Split only LESS on $.

As guenther@ said "STOP SPLITTING ANYTHING BUT $LESS ON '$' !".

anton@ came up with the same diff. ok nicm@

Revision 1.35 / (download) - annotate - [select for diffs], Sat Sep 17 15:06:41 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.34: +1 -1 lines
Diff to previous 1.34 (colored)

little bit more KNF

Revision 1.34 / (download) - annotate - [select for diffs], Sun Aug 28 07:25:47 2016 UTC (7 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

Check the MORE (or LESS) environment variables after forcing the various
more(1) options, so it is possible to change them using MORE. From Ross
L Richardson. ok deraadt millert

Revision 1.33 / (download) - annotate - [select for diffs], Wed Mar 16 15:36:26 2016 UTC (8 years, 2 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

style(9) includes

ok nicm@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Jan 12 23:01:23 2016 UTC (8 years, 4 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.31: +0 -3 lines
Diff to previous 1.31 (colored)

remove lint annotations

ok nicm@

Revision 1.31 / (download) - annotate - [select for diffs], Fri Nov 20 16:22:33 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +1 -1 lines
Diff to previous 1.30 (colored)

spaces

Revision 1.30 / (download) - annotate - [select for diffs], Sat Nov 14 20:13:29 2015 UTC (8 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.29: +3 -4 lines
Diff to previous 1.29 (colored)

Correct check flipped in earlier commit.
Eliminate unnecessary isupper() tests before tolower() use

ok millert@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Nov 13 16:48:48 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.28: +1 -1 lines
Diff to previous 1.28 (colored)

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

Revision 1.28 / (download) - annotate - [select for diffs], Wed Nov 11 02:56:07 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.27: +9 -3 lines
Diff to previous 1.27 (colored)

exit if pledge fails

Revision 1.27 / (download) - annotate - [select for diffs], Mon Nov 9 21:25:06 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

use perror() instead, as in lesskey

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 9 18:41:46 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +2 -3 lines
Diff to previous 1.25 (colored)

stop acting like "more" if progname is "page"; ok millert

Revision 1.25 / (download) - annotate - [select for diffs], Mon Nov 9 16:46:43 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

NULL_IFILE has no weird use patterns.  NULL is sufficient.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Nov 9 16:39:13 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)

error() is not a stdarg function, so there is no reason for NULL_PARG
to be special.  Simply use NULL.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Nov 9 16:36:10 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +13 -0 lines
Diff to previous 1.22 (colored)

3 pledge calls; 2 are for secure mode and will help track down if this
code really meets the promise of "no writes".
Some hints from nicm and semarie.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Nov 9 16:34:02 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

do not save history in secure mode

Revision 1.21 / (download) - annotate - [select for diffs], Mon Nov 9 03:09:19 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.20: +0 -1 lines
Diff to previous 1.20 (colored)

close_getchr() is now a noop

Revision 1.20 / (download) - annotate - [select for diffs], Sat Nov 7 18:07:44 2015 UTC (8 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.19: +6 -17 lines
Diff to previous 1.19 (colored)

replace save() with estrdup() and make estrdup() exit like all the other
ecalloc, etc. functions do.
ok mmcc nicm

Revision 1.19 / (download) - annotate - [select for diffs], Fri Nov 6 15:50:33 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.18: +2 -4 lines
Diff to previous 1.18 (colored)

Garrett D'Amore has agreed to moving his copyright line up above the
terms with the existing copyright, so it is clear it applies the same
terms.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Nov 5 22:18:27 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

whitespace

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 5 22:08:44 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.16: +161 -196 lines
Diff to previous 1.16 (colored)

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

Revision 1.16 / (download) - annotate - [select for diffs], Tue May 13 02:34:58 2014 UTC (10 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.15: +2 -0 lines
Diff to previous 1.15 (colored)

All callers of helpfile() are #ifdef SMALL so only define that
function when SMALL is not defined.  OK guenther@

Revision 1.15 / (download) - annotate - [select for diffs], Sat May 10 16:45:23 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.14: +7 -1 lines
Diff to previous 1.14 (colored)

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@

Revision 1.14 / (download) - annotate - [select for diffs], Fri Apr 25 18:07:41 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.13: +0 -4 lines
Diff to previous 1.13 (colored)

Make more(1) POSIX compliant with respect to the -e option.
By default, "more" now works like "less -e", and "more -e" now
works like "less -E", and more never exits just because the file
fits on the first screen, like "less -F" would.

While documenting this, add some text to the DESCRIPTION explaining
how paging works.  That allows a very concise description of -e.

code change ok millert@
manual page joint work with and ok jmc@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Apr 25 13:38:21 2014 UTC (10 years ago) by shadchin
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Merge Less 458 plus local patches

ok guenther@, ok jmc@ for man bits

Revision 1.1.1.4 / (download) - annotate - [select for diffs] (vendor branch), Fri Apr 25 13:33:49 2014 UTC (10 years ago) by shadchin
Branch: markn, MARK_NUDELMAN
CVS Tags: LESS_458
Changes since 1.1.1.3: +24 -12 lines
Diff to previous 1.1.1.3 (colored)

Import of Less 458

ok guenther@

Revision 1.12 / (download) - annotate - [select for diffs], Tue Mar 27 06:22:45 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.11: +1 -0 lines
Diff to previous 1.11 (colored)

Reverse the default of the -c flag from off to on to prevent the text
being displayed in the wrong place initially and then jumping when first
redrawn (such as when searching).

ok deraadt sthen

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 16 18:12:09 2011 UTC (12 years, 8 months ago) by shadchin
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.10: +45 -22 lines
Diff to previous 1.10 (colored)

Merge in less 444 plus local changes

ok nicm@

Revision 1.1.1.3 / (download) - annotate - [select for diffs] (vendor branch), Fri Sep 16 17:47:06 2011 UTC (12 years, 8 months ago) by shadchin
Branch: markn, MARK_NUDELMAN
CVS Tags: LESS_444
Changes since 1.1.1.2: +32 -9 lines
Diff to previous 1.1.1.2 (colored)

Import of Less 444

ok nicm@

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jul 3 16:29:46 2010 UTC (13 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.9: +2 -0 lines
Diff to previous 1.9 (colored)

use SMALL_PROGRAM to knock out some code

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 4 04:45:01 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.8: +1 -0 lines
Diff to previous 1.8 (colored)

It turns out that POSIX specifies more should prompt with the file name,
not --More-- like the old UCB more did.  Back out a hack I did to
make the prompt look like the old UCB more.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Apr 14 14:33:57 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.7: +0 -3 lines
Diff to previous 1.7 (colored)

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

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 13 18:26:26 2003 UTC (21 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.6: +137 -94 lines
Diff to previous 1.6 (colored)

Merge in less-381 w/ local changes and remove obsolete files.

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Sun Apr 13 18:21:21 2003 UTC (21 years, 1 month ago) by millert
Branch: markn, MARK_NUDELMAN
CVS Tags: LESS_381
Changes since 1.1.1.1: +128 -74 lines
Diff to previous 1.1.1.1 (colored)

Stock less-390 with some unneeded DOS/Windoze files removed

Revision 1.6 / (download) - annotate - [select for diffs], Sat Apr 5 01:03:35 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.5: +5 -3 lines
Diff to previous 1.5 (colored)

some more string shit; krw ok

Revision 1.5 / (download) - annotate - [select for diffs], Mon Nov 19 19:02:14 2001 UTC (22 years, 6 months ago) by mpech
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

kill more registers

millert@ ok

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 29 01:58:03 2001 UTC (23 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.3: +2 -0 lines
Diff to previous 1.3 (colored)

$OpenBSD$

Revision 1.3 / (download) - annotate - [select for diffs], Fri Mar 5 18:44:02 1999 UTC (25 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.2: +7 -1 lines
Diff to previous 1.2 (colored)

provide support for -- argument seperator

Revision 1.2 / (download) - annotate - [select for diffs], Sat Sep 21 06:06:40 1996 UTC (27 years, 8 months ago) by etheisen
Branch: MAIN
CVS Tags: OpenBSD_1_2, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +14 -2 lines
Diff to previous 1.1 (colored)

Incorporate less modifications for more and our bug fixes from previous
version.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sat Sep 21 05:39:41 1996 UTC (27 years, 8 months ago) by etheisen
Branch: markn, MARK_NUDELMAN
CVS Tags: less_290
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Import of unmolested less-290.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Sep 21 05:39:41 1996 UTC (27 years, 8 months ago) by etheisen
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.