Commit Graph

99 Commits

Author SHA1 Message Date
roy 98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
dholland 10a5ee8495 Don't attempt to read or write ~/.lesshst if it's not a regular file
or a symlink to a regular file. Previously, symlinking to /dev/null
would cause less to trash /dev/null if run with sufficient privileges,
as seen in PR misc/42237.

While the official way to disable .lesshst is to set an environment
variable, that is problematic in some cases, such as single-user mode.
A safer way to prevent even an unpatched less from writing anything
out is to mkdir ~/.lesshst.
2009-12-14 03:58:27 +00:00
drochner 51f9e504fe kill a stray semicolon which made that the "-p <cmd>" option in
POSIX mode didn't work as expected
2009-11-16 19:40:17 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
mrg 8cdb9d89bb don't parse $LESS env-var in more_mode. (also, don't parse $LESS twice
in non more_mode.)
2008-08-28 07:20:20 +00:00
mrg c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
matt d8485be816 Fix numerous inconsistent variable declaration. Resulting in some minor
constification.
2008-02-16 07:20:54 +00:00
jmmv c5e6a57d43 Add the list of differences between more and less provided by mrg@ in
PR bin/31415.
2006-12-17 16:16:53 +00:00
dsl efbf65678a Don't add all the help text when SMALLPROG is set. 2006-11-20 22:06:26 +00:00
mrg 272d745880 #if 0 some unused variables. 2006-10-26 01:38:11 +00:00
mrg fd95deac95 merge less-394. 2006-10-26 01:33:08 +00:00
mrg cea4831cdf import less 394. this includes these changes:
* Add history file to save search and shell command history between
  invocations of less.

* Improve behavior of history list for search and shell commands.

* Add -K (or --quit-on-intr) option to make less exit immediately on ctrl-C.

* Improve handling of UTF-8 files and commands, including better
  line wrapping and handling double-width chars.

* Added LESSUTFBINFMT environment variable to control display of
  non-printable characters in a UTF-8 file.

* Add --with-secure option to configure, to make it easier to
  build a secure version of less.

* Show search matches in the status column even if search highlights
  are disabled via the -G option or the ESC-u command.

* Improve performance when the file contains very long lines.

* Add "windows" charset.

* Add man page for lessecho.

* Add support for erase2 character, treated same as erase.

* Use ASCII lowercase/uppercase logic when operating on the command line.

* Update makefile for Borland C++ 5.5.1.

* Fix bug in calculating number of pages for %D prompt.

* Fix bug in handling tag file error.

* Fix obscure bug if input file is deleted while viewing help.

* Fix bug handling filenames which include square brackets.

* Fix possible buffer overflow in "global" tag search.

* Fix possible buffer overflow in usage of LESSOPEN and LESSCLOSE.

* Fix buffer overflow in reverse search.

* Removed some old copyrighted code.
  This probably breaks OS/9 support.
2006-10-26 01:31:48 +00:00
mrg ad5d44bc09 also need charset.h now. 2006-10-26 01:30:33 +00:00
mrg 556af87115 import less 394. this includes these changes:
* Add history file to save search and shell command history between
  invocations of less.

* Improve behavior of history list for search and shell commands.

* Add -K (or --quit-on-intr) option to make less exit immediately on ctrl-C.

* Improve handling of UTF-8 files and commands, including better
  line wrapping and handling double-width chars.

* Added LESSUTFBINFMT environment variable to control display of
  non-printable characters in a UTF-8 file.

* Add --with-secure option to configure, to make it easier to
  build a secure version of less.

* Show search matches in the status column even if search highlights
  are disabled via the -G option or the ESC-u command.

* Improve performance when the file contains very long lines.

* Add "windows" charset.

* Add man page for lessecho.

* Add support for erase2 character, treated same as erase.

* Use ASCII lowercase/uppercase logic when operating on the command line.

* Update makefile for Borland C++ 5.5.1.

* Fix bug in calculating number of pages for %D prompt.

* Fix bug in handling tag file error.

* Fix obscure bug if input file is deleted while viewing help.

* Fix bug handling filenames which include square brackets.

* Fix possible buffer overflow in "global" tag search.

* Fix possible buffer overflow in usage of LESSOPEN and LESSCLOSE.

* Fix buffer overflow in reverse search.

* Removed some old copyrighted code.
  This probably breaks OS/9 support.
2006-10-26 01:05:30 +00:00
peter e263dfd62f WFORMAT is no more... 2006-10-08 17:52:28 +00:00
elad ac3134b0c7 PR/21741: Christian Biere: Buffer overrun and wrong usage of islower() in
less 381
Over three years ago the less maintainer said he'll add these fixes.
Nothing happened, so we do it ourselves.
Thanks for the report and the patch!
2006-09-23 12:51:18 +00:00
christos 7a029a3c6a XXX: GCC uninitialized variables 2006-05-14 02:51:03 +00:00
christos 05d6ead1e0 Coverity CID 1223: Avoid calling close with a negative fd. 2006-05-01 22:57:16 +00:00
christos 7c1fafb5f3 Coverity CID 1233: Avoid negative index. 2006-05-01 22:55:50 +00:00
christos 3b6811d33b PR/33123: Murray Armfield: standards compliance & glob.h
Certain fields in glob.h need to be size_t; fix this and version glob(3).
    http://www.opengroup.org/onlinepubs/000095399/basedefs/glob.h.html
2006-03-26 18:11:22 +00:00
tron 4616c2367c Fix a one byte off error which causes "less" to crash if you view a
large file, jump to the end, scroll backwards with "b" and try to
search backwards afterwards.
2005-08-24 11:33:09 +00:00
dsl 5355c81879 Add (unsigned char) cast to ctype functions 2004-10-30 20:17:19 +00:00
wiz 0c3e116cc5 From OpenBSD:
revision 1.7
date: 2004/04/08 15:18:28;  author: millert;  state: Exp;  lines: +5 -7
When reallocating the line buffer, double the existing buffer
size instead of just incrementing it by LINEBUF_SIZE and use realloc()
+ memset() instead of calloc() + memcpy().  Prevents excessive resource
usage when displaying very long lines.  OK deraadt@, krw@ and otto@

Ok'd by mrg.
2004-08-26 01:29:20 +00:00
wiz 03a2c411d5 Fix documentation of lesskey config file path per PR 23597
by Christian Biere.
2003-11-30 01:17:03 +00:00
wiz 4bbfee09ca Various typo fixes from Jonathon Gray via jmc@openbsd. 2003-11-17 11:16:10 +00:00
mrg a1c0290e03 reorder some structure definitions to appease gcc3.3 2003-07-26 16:02:25 +00:00
mrg 0634cd7fff fix build errors 2003-04-14 03:02:28 +00:00
mrg 1492c6b657 merge less 381 2003-04-14 02:56:45 +00:00
mrg e0555382b4 import less 381. changes:
v375   4/7/02   Fix searching for SGR sequences; fix SECURE build;
                add SGR support to DJGPP version (thanks to Eli Zaretskii).
v376  6/10/02   Fix bug in overstriking mulitbyte UTF-8 characters
                (thanks to Jungshik Shin).
                Posted to Web page.
-----------------------------------------------------------------
v377  9/10/02   Fix bug in Windows version when file contains CR;
                fix bug in search highlights with -R;
                make initial buffer limit really be 64K not unlimited.
v378  9/30/02   Misc bug fixes and compiler warning cleanup.
                Posted to Web page.
-----------------------------------------------------------------
v379 11/23/02   Add -L option; fix bug with ctrl-K in lesskey files;
                improve UTF-8 overstriking and underscore overstriking;
                fix minor man page problems; change to autoconf 2.54.
v380 11/24/02   Make LINENUM same as POSITION.
v381 11/28/02   Make -N use 7 columns for line number if possible.
2003-04-14 02:09:56 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
thorpej 22887c3c29 Avoid strict alias warning. 2002-12-06 02:57:30 +00:00
lukem 5d4973fe97 makefile delint. use NETBSDSRCDIR as appropriate 2002-09-18 14:00:33 +00:00
wiz ab4ef2b995 Remove !__STDC__. 2002-06-15 18:27:20 +00:00
simonb 592e570685 Remove prototypes for some static functions that don't exist. 2002-03-05 12:54:34 +00:00
mrg 235e0d0060 clean up. 2002-03-05 12:32:16 +00:00
mrg 4192ea474e merge less-374 2002-03-05 12:28:31 +00:00
mrg 9668e4f341 less 374 2002-03-05 11:44:53 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
pk f9a6face66 * Avoid stale pointers into a previously used termcap buffer.
* Skip ti/te capabilities only when using -E or when in `more mode'.
2002-01-14 10:36:25 +00:00
tv 8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
wiz aded0d2cce Whitespace cleanup. 2001-12-01 16:43:07 +00:00
mrg b0caae0467 clean up WARNS. 2001-07-26 14:20:47 +00:00
mrg ec2876e2a5 add a new header file. 2001-07-26 13:47:24 +00:00
mrg c001ebc093 don't need this. 2001-07-26 13:46:39 +00:00
mrg 172ab14d0e merge cornflakes (less 358) 2001-07-26 13:43:43 +00:00
mrg 95a4fc7c7a less 358 2001-07-26 12:00:22 +00:00
wiz 3f9984fc90 `existent', not `existant' 2001-06-19 13:42:07 +00:00
cgd a8ec668ddf convert to use getprogname() 2001-02-19 23:03:42 +00:00
lukem c2b84904ae use %ll_ instead of the less standard %q_ 2001-01-04 23:05:54 +00:00
is 135600f947 More format string cleanup by sommerfeld. 2000-10-11 14:46:00 +00:00