Commit Graph

64 Commits

Author SHA1 Message Date
Tim Vanderhoek bc2f9c0fa6 Correctly backspace over number N that preceeds macros. 2000-01-08 18:11:05 +00:00
Tim Vanderhoek aa52177fb5 Dedocument one of the BUGS listed in the last commit. The bug (needless
calculation of line numbers) never existed and the two bugs that made me
think it existed have been fixed (see recent commits about this date to
linenum.c:r.1.3 and ch.c:r.1.8 fixing broken line-number buffering and
braindead algorithms respectively).
1999-12-28 05:56:33 +00:00
Tim Vanderhoek e965d6a895 Rather than use an LRU-ordered circular list to store buffered data,
simply keep an index into the last access on the circular list and begin
searches at that point.  An LRU list is inappropriate here since the
vast majority of accesses will occur in the same order that the list
is created in.  The only case where an LRU is remotely useful here is when
reading from a file and the user is jumping to randomish positions and
constantly returning to some central position.  Even for this case it is
such a small optimization as not to be noticed in an interactive program
such as more(1).

This change results in a _tremendously_ noticable speed-up when reading long
files through a pipe (where long = ~200k, machine = ~2.5h single-disk
worldstone).
1999-12-28 05:47:24 +00:00
Tim Vanderhoek 427db879c9 Delete dead code and clean comments a little. 1999-12-28 03:01:20 +00:00
Tim Vanderhoek 79bf951d43 Correctly maintain state when manipulating linked lists. This fixes a
bug that prevented the line-number buffer from working correctly.  AFAIK
the bug is still present in other derivatives of more(1).
1999-12-27 20:53:35 +00:00
Tim Vanderhoek defd7401e5 Initialize unitialized variable from prev. commit. 1999-12-27 17:33:25 +00:00
Tim Vanderhoek 83d9b479e2 A missing verb to a sentence from last commit. 1999-12-26 04:41:29 +00:00
Tim Vanderhoek 3fc3b10351 For some reason the HOME key wasn't documented. Document it. Expand
the docs on a couple other keys.  While I'm here, document another ~3 bugs
that have been around for all eternity in the hope that I'll someday bother
to fix them.
1999-12-26 04:17:27 +00:00
Tim Vanderhoek db0d7f4131 Allow excessive backspacing to correctly abort an input (most significantly
a search string input).
1999-12-26 03:03:04 +00:00
Tim Vanderhoek 9a49dca0b1 Expand source comments a little -=> increased readability. 1999-12-26 02:39:26 +00:00
Tim Vanderhoek 62998af2a6 Don't disallow null search patterns --- they are interpreted as being
identical to the previous pattern.

Noticed-by:	Jeroen Ruigrok/Asmodai
1999-09-14 21:20:58 +00:00
Tim Vanderhoek 6636e220ef Remove assertion of Shigio Yamaguchi's copyright, by request in bin/13607. 1999-09-10 23:40:39 +00:00
Ruslan Ermilov 16e9510051 Unbroke `make -s' case.
PR:		13676
Submitted by:	wollman
1999-09-10 07:39:25 +00:00
Peter Wemm 1389c7307f $Id$ -> $FreeBSD$ 1999-09-05 19:13:04 +00:00
Tim Vanderhoek 20d6e5fe6e Thorough revamp of how input commands are processed. This allows customization
of user keys (documentation pending).  The only key whose semantics have
changed is the capital 'N' key, which now performs a repeat-search in the
opposite direction (just like in vi).

This commit is a little bulkier than what I had originally planned.  I'm not
completely happy with the direction it went, but it's definately an
improvement, and the alternative is to continue becoming irrelevant compared
to GNU less.  (Does anyone even _use_ /usr/bin/more these days?)
1999-09-03 22:31:21 +00:00
Peter Wemm c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Tim Vanderhoek fb320ea83a Don't assume all ctags are meant to match a whole line ("^...line...$").
This lets more(1) work with, for example, /usr/local/share/vim/doc/*.txt.
1999-08-17 00:49:40 +00:00
Mike Pritchard a4cab7d390 Various man page cleanup:
- Sort xrefs
- Be consistent with section names as outlines in mdoc(7).
- Other misc mdoc cleanup.

PR:		doc/13144
Submitted by:	Alexey M. Zelkin <phantom@cris.net>
1999-08-15 08:25:34 +00:00
Nik Clayton 3be5f1f5ce Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:24:20 +00:00
Tim Vanderhoek 296697bb16 - When trying to decide if $EDITOR == "vi", match against only the first
two characters of $EDITOR.  This allows things like "vim" and "vi -G"
  (although nvi would fail...oh well).

- Avoid certain cases where the editor is passed an invalid line number.
1999-06-05 20:27:08 +00:00
Tim Vanderhoek c5b52d6d9d No, the space required for a string is strlen() _plus_ one... Oops. 1999-06-04 19:35:22 +00:00
Tim Vanderhoek 5bba1d262a Don't print backspaces in first column since they backup to the prev line. 1999-06-02 03:42:39 +00:00
Tim Vanderhoek ac8ab44cf6 Grok gtags too. 1999-06-01 20:02:34 +00:00
Tim Vanderhoek 0ac2ad320e General code cleanup [incomplete]. Make the arrow keys work. 1999-05-30 18:06:58 +00:00
Tim Vanderhoek 3309076f0b Document another (less-virulent) CRLF-related bug. 1999-05-02 18:17:23 +00:00
Tim Vanderhoek d75db65f59 Remove documentation of CRLF bug from more.1. Sync code with manpage.
PR:		bin/961 bin/7296 (fix)
Submitted by:	Garance Alistair Drosehn <gad@eclipse.acs.rpi.edu>
1999-04-29 18:03:38 +00:00
Tim Vanderhoek 1707aceca1 Ignore (effectively) SIGTSTP if we're already in the process of tstoping. 1998-08-03 03:11:09 +00:00
Tim Vanderhoek b410b35213 Fix coredump when two signals are sent in rapid succession.
PR:		bin/5721
Submitted by:	Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>

Also, add "volatile" to a variable modified by signal handlers (coincidentally,
the same variable involved in the above fix, although this isn't related
to the reported problem).
1998-07-31 04:05:11 +00:00
Tim Vanderhoek a65adfc05c Fix compilation for the case where neither ioctl(TIOCGWINSZ)
nor ioctl(WIOCGETD) exist.  This case doesn't occur under FreeBSD.

PR:		bin/5996
Submitted by:	Max Euston <meuston@jmrodgers.com>
1998-07-26 16:15:26 +00:00
Tim Vanderhoek b0ab44a317 Really delete -# option. 1998-07-25 05:58:04 +00:00
Tim Vanderhoek 42580a0726 Nuke obsolote and broken -# option.
Order options.

PR:		bin/5996
Submitted by:	Max Euston <meuston@jmrodgers.com>
1998-07-25 05:56:49 +00:00
Tim Vanderhoek b3841c3bd9 Keep "-c" (top_scroll) through viewing help.
PR:		bin/5996
Submitted by:	Max Euston <meuston@jmrodgers.com>
1998-07-25 05:28:32 +00:00
Tim Vanderhoek 7b31132c01 Fix bug from last commit: don't SEGV when reading as part of a pipe. 1998-07-04 01:22:07 +00:00
Tim Vanderhoek 2c4d94647c Use '-e' when viewing helpfile. 1998-07-03 23:01:33 +00:00
Tim Vanderhoek 36c29707b7 Prevent recursive help)elp)elping. 1998-07-03 17:12:10 +00:00
Steve Price a84507eabd sprintf -> snprintf to avoid potential buffer overflow.
PR:		6907
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-06-14 16:03:40 +00:00
Philippe Charnier 306005e78c .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq. 1998-03-23 07:48:45 +00:00
John Birrell 6216c30a1c Add #include <string.h> to get prototypes for functions that gcc
has builtin (and wants to know that the prototypes match).
1998-02-20 04:13:29 +00:00
Eivind Eklund e351dd657b Fix fencepost error.
PR:		4170
Submitted by:	Harlan Stenn <Harlan.Stenn@pfcs.com>
1997-08-12 14:42:39 +00:00
Philippe Charnier 096118ee27 Add usage(). 1997-07-29 06:42:33 +00:00
Bruce Evans f4c1975c26 Removed inconsistent declaration of malloc(). `make world' with DESTDIR
set to something other than "/" now actually works.
1997-04-23 10:16:58 +00:00
Warner Losh 1c8af87873 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
Joerg Wunsch 984e3edbe2 Make more not immediately exit on a short file, if the -e option is
given.  This makes more -e basically usable at all when your termcap
entry supports an alternate screen buffer (like xterm-r6).

I wonder whether we should make more -e the default.  Oure more seems
to be the only one on the world with this funny behaviour.

2.2 candidate

Submitted by:	dawes@rf900.physics.usyd.edu.au (David Dawes)
1997-03-02 18:55:42 +00:00
Peter Wemm c115df18cd Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Andrey A. Chernov faeaf734aa include ctype.h to pick isprint macro 1997-01-12 13:34:13 +00:00
Andrey A. Chernov 6004290380 Pick collate info for RE character ranges 1996-08-11 16:22:47 +00:00
Adam David 8d8d270920 Document the CRLF bug 1996-01-22 03:48:47 +00:00
Adam David bb012025b4 'more | cat' was producing spurious output from an unused buffer 1996-01-22 01:30:03 +00:00
Andrey A. Chernov eb1d32b9a3 Add setlocale LC_CTYPE 1995-10-24 05:18:36 +00:00