OpenBSD CVS

CVS log for src/usr.bin/man/Attic/man.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.50, Fri Mar 27 01:59:26 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.49: +1 -1 lines
FILE REMOVED

Move help(1) to share/man and send the remains of man(1) to the Attic.
It is implemented by the code in usr.bin/mandoc since OpenBSD 5.7.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:09 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.48: +1 -2 lines
Diff to previous 1.48 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jul 1 18:47:39 2013 UTC (10 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.47: +7 -5 lines
Diff to previous 1.47 (colored)

Make some variables const that are filled from getenv(3), from argv,
from optarg and from literal strings - for clarity and to make sure
that future code changes do not attempt to write to them.
No functional change.

ok jca@

Revision 1.47 / (download) - annotate - [select for diffs], Mon Jul 1 17:16:03 2013 UTC (10 years, 10 months ago) by jca
Branch: MAIN
Changes since 1.46: +8 -39 lines
Diff to previous 1.46 (colored)

Kill off some code that undocumently added an "-s" switch if user had
specified "more" as (MAN)PAGER.  Document the default pager used while
here.  Discussed with schwarze@, ok schwarze@ millert@, jasper@ agrees.

Users can get the previous behaviour by specifying eg.
export MANPAGER="more -s".

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jun 26 19:56:45 2013 UTC (10 years, 10 months ago) by jca
Branch: MAIN
Changes since 1.45: +15 -7 lines
Diff to previous 1.45 (colored)

Avoid mangling argv and environment variables.
ok schwarze@ sthen@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Feb 5 18:51:18 2012 UTC (12 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.44: +6 -3 lines
Diff to previous 1.44 (colored)

Do not insert an empty ENTRY into the manpath list;
it's useless and causes out-of-bounds array access later.
While here, remove two unused local variables and two unused struct members.
From Tobias Ulmer <tobiasu at tmux dot org> on tech@, thanks.
"off to you" deraadt@

Revision 1.44 / (download) - annotate - [select for diffs], Thu Jan 5 21:46:15 2012 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.43: +8 -7 lines
Diff to previous 1.43 (colored)

When iterating a TAILQ list replacing elements,
get a pointer to the next element before freeing the previous one,
do not access free'd pointers.  Problem found the hard way
by fgsch@ running "man -a x" with malloc.conf -> S on amd64.
ok deraadt@

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jul 7 04:24:35 2011 UTC (12 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.42: +67 -15 lines
Diff to previous 1.42 (colored)

For man -a and -w, drop companion pages that are also in the path,
such that we don't display them twice.
To be able to do that path check, we have to brace-expand the search
path up front - of course, for -a and -w only, so it doesn't slow
us down in the standard case.

As a free bonus, let -wa print all the filenames without looking
at the timestamps.  In the past, -w implied -a, so that's not
introducing any incompatibility.

Issue originally reported and fix OK'd by guenther@,
and deraadt@ agrees with the semantics.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jul 5 05:47:20 2011 UTC (12 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +80 -2 lines
Diff to previous 1.41 (colored)

When both a formatted and an unformatted version of the same manual page
are available in the same tree, only show the newer of the two.
So far, this only handles the case without -a;
i need to look at the case with -a next.

Revision 1.41 / (download) - annotate - [select for diffs], Wed May 25 14:36:04 2011 UTC (12 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.40: +38 -32 lines
Diff to previous 1.40 (colored)

add one more signal block for handling '_intmp' (the list of files scheduled
to be deleted at termination), and then make the signal handler race safe.
ok nicm

Revision 1.40 / (download) - annotate - [select for diffs], Fri Oct 22 14:08:53 2010 UTC (13 years, 7 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.39: +1 -8 lines
Diff to previous 1.39 (colored)

whining verboten;  ok deraadt

Revision 1.39 / (download) - annotate - [select for diffs], Fri Mar 19 21:04:25 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.38: +175 -134 lines
Diff to previous 1.38 (colored)

Fix three bugs in man(1):
 * when combining -m $path with -s $section, -s was ignored
 * when combining -m with -s, ONLY $path was searched, like with -M
 * when combining -M (or $MANPATH) with -s, -M was ignored

Instead, when combining -m, -M or $MANPATH with -s, let's simply look into
$path/{cat,man}$section{/$arch,} first (for -m) or only (for -M or $MANPATH).
Do not change the behaviour in other cases.

This required a rewrite of the whole path handling,
as a bonus also making the code easier to understand.
Hopefully, it helps to fix www.openbsd.org/cgi-bin/man.cgi properly.

Jason convinced me that changing the manual is not really needed.
Regression tests will follow when the tree unlocks completely.

"you are on the right track" beck@
tested and agreed by jmc@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:40 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.37: +1 -15 lines
Diff to previous 1.37 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.37 / (download) - annotate - [select for diffs], Tue Dec 30 13:14:41 2008 UTC (15 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.36: +6 -3 lines
Diff to previous 1.36 (colored)

make -S case insensitive; this avoids any confusion over the fact
that MD page headers use mixed case; tidy up the man page regarding this;

diff from Ingo Schwarze
ok sobrado millert krw

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jan 4 22:37:54 2008 UTC (16 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.35: +4 -4 lines
Diff to previous 1.35 (colored)

-k and -f accept multiple arguments; from Pierre Riteau

Revision 1.35 / (download) - annotate - [select for diffs], Mon Aug 6 19:16:06 2007 UTC (16 years, 9 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

the ellipsis is not an optional argument; while here, sync the usage
and synopsis of commands

lots of good ideas by jmc@

ok jmc@

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jun 4 20:40:10 2007 UTC (16 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.33: +19 -8 lines
Diff to previous 1.33 (colored)

make jmc happy by somewhat smarter synopsis scanning code for -h; ok
jaredy@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jan 9 18:01:53 2007 UTC (17 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored)

fix usage

Revision 1.32 / (download) - annotate - [select for diffs], Thu Dec 14 19:25:58 2006 UTC (17 years, 5 months ago) by jasper
Branch: MAIN
Changes since 1.31: +5 -3 lines
Diff to previous 1.31 (colored)

Coverity CID 2996: Don't return without closing fp.
Fix from christos NetBSD.

ok otto@, millert@ (earlier version)

Revision 1.31 / (download) - annotate - [select for diffs], Sat Nov 12 00:51:13 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.30: +4 -7 lines
Diff to previous 1.30 (colored)

use asprintf instead; dhill@mindcry.org

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 31 10:38:04 2005 UTC (18 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.29: +8 -18 lines
Diff to previous 1.29 (colored)

Rewrite -m processing to not use queue internals and make it more
simple as well. ok hshoexer@ jaredy@ henning@

Revision 1.29 / (download) - annotate - [select for diffs], Mon Oct 17 19:08:46 2005 UTC (18 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.28: +27 -29 lines
Diff to previous 1.28 (colored)

Use queue macros instead of directly accessing fields. ok pat@ "put it
in" deraadt@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Feb 23 14:14:14 2004 UTC (20 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: 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
Changes since 1.27: +5 -4 lines
Diff to previous 1.27 (colored)

- mark up punctuation
- use more suitable macros where necessary
- a little grammar
- sort options and sync usage() (last part checked by henning)

Revision 1.27 / (download) - annotate - [select for diffs], Tue Dec 16 18:58:46 2003 UTC (20 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.26: +7 -4 lines
Diff to previous 1.26 (colored)

Support MANPAGER environment variable plus some KNF I had in my tree.
Closes PR 3563

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jun 10 22:20:48 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.25: +3 -6 lines
Diff to previous 1.25 (colored)

mostly ansi cleanup; pval ok

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:12 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.24: +3 -7 lines
Diff to previous 1.24 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Mar 13 09:09:32 2003 UTC (21 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.23: +6 -5 lines
Diff to previous 1.23 (colored)

lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu

Revision 1.23 / (download) - annotate - [select for diffs], Sun Dec 8 16:50:07 2002 UTC (21 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

GNU semantics say that if optstring begins with '-' then
each non-option shall be treated as arguments to option '\1'.

BSD getopt match '-' in optstring with a '-' on the command line.
This is used to support deprecated options like "su -" that would
otherwise prevent the use of getopt().

Resolving this simply requires that the leading '-' be moved somewhere
else (I moved it to the end of optstring) since position within
optstring is not meaningful.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Nov 23 18:43:29 2002 UTC (21 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

let comment match reality. ok millert@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Sep 17 19:37:39 2002 UTC (21 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.20: +25 -26 lines
Diff to previous 1.20 (colored)

ansi

Revision 1.20 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:48 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.19: +11 -11 lines
Diff to previous 1.19 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Nov 17 03:09:44 2001 UTC (22 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.18: +17 -3 lines
Diff to previous 1.18 (colored)

make signal handler safe, by blocking signals around the things that it cares about; millert ok

Revision 1.18 / (download) - annotate - [select for diffs], Sat Aug 18 21:59:37 2001 UTC (22 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

whack strcpy

Revision 1.17 / (download) - annotate - [select for diffs], Tue Apr 10 02:32:33 2001 UTC (23 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.16: +23 -19 lines
Diff to previous 1.16 (colored)

space police + pet peeves
use memcpy() not memmove() when we don't care about overlapping segments
use puts(foo) instead of print("%s\n", foo)

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jan 31 19:26:51 2001 UTC (23 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +8 -5 lines
Diff to previous 1.15 (colored)

KNF

Revision 1.15 / (download) - annotate - [select for diffs], Mon Oct 18 01:46:36 1999 UTC (24 years, 7 months ago) by aaron
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
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Add a help(1) man page -- help for new users and administrators.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jul 28 01:17:56 1999 UTC (24 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

clarify

Revision 1.13 / (download) - annotate - [select for diffs], Thu Jun 10 22:38:02 1999 UTC (24 years, 11 months ago) by pjanzen
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Handle PAGER in a manner consistent with the Single Unix Specification:
that is, use PAGER rather than "more" if it is defined and non-null, not
just if it is defined.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 16 06:28:32 1998 UTC (25 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

off by one string termination; wsanchez

Revision 1.11 / (download) - annotate - [select for diffs], Mon Sep 14 05:44:12 1998 UTC (25 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.10: +12 -2 lines
Diff to previous 1.10 (colored)

/usr/bin/help == man man"

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jul 20 01:15:25 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +4 -2 lines
Diff to previous 1.9 (colored)

finish off fixing PR 536 completely

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 1 11:23:40 1998 UTC (25 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.8: +9 -4 lines
Diff to previous 1.8 (colored)


Fix confusing error message

Revision 1.8 / (download) - annotate - [select for diffs], Sat Apr 25 00:25:37 1998 UTC (26 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.7: +6 -4 lines
Diff to previous 1.7 (colored)

fix usage

Revision 1.7 / (download) - annotate - [select for diffs], Mon Mar 9 23:20:13 1998 UTC (26 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.6: +20 -9 lines
Diff to previous 1.6 (colored)

Add -s section for svr4 compat and -S subsection ala:
    man -s 4 -S alpha scc

Revision 1.6 / (download) - annotate - [select for diffs], Wed Sep 10 04:16:30 1997 UTC (26 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

path buf too small; tron@lyssa.owl.de

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jan 15 23:42:52 1997 UTC (27 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

getopt(3) returns -1 when out of args, not EOF, whee!

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 16 02:26:10 1996 UTC (27 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.3: +4 -4 lines
Diff to previous 1.3 (colored)

_PATH_TMP -> _PATH_TMPFILE; avoid /tmp//fooXXXX where possible too

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jul 18 22:52:58 1996 UTC (27 years, 10 months ago) by michaels
Branch: MAIN
Changes since 1.2: +16 -6 lines
Diff to previous 1.2 (colored)

bugfix, paths added with -w should now be searched in the same order
as the rest, and not in reverse.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 26 05:37:01 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

rcsid

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:46 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:46 1995 UTC (28 years, 7 months ago) by deraadt
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.