summaryrefslogtreecommitdiffstats
path: root/usr.bin/man/man.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move help(1) to share/man and send the remains of man(1) to the Attic.schwarze2015-03-271-939/+0
| | | | It is implemented by the code in usr.bin/mandoc since OpenBSD 5.7.
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+1
| | | | | | | | | 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)
* Make some variables const that are filled from getenv(3), from argv,schwarze2013-07-011-5/+7
| | | | | | | | 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@
* Kill off some code that undocumently added an "-s" switch if user hadjca2013-07-011-39/+8
| | | | | | | | 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".
* Avoid mangling argv and environment variables.jca2013-06-261-7/+15
| | | | ok schwarze@ sthen@
* Do not insert an empty ENTRY into the manpath list;schwarze2012-02-051-3/+6
| | | | | | | 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@
* When iterating a TAILQ list replacing elements,schwarze2012-01-051-7/+8
| | | | | | | 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@
* For man -a and -w, drop companion pages that are also in the path,schwarze2011-07-071-15/+67
| | | | | | | | | | | | | | 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.
* When both a formatted and an unformatted version of the same manual pageschwarze2011-07-051-2/+80
| | | | | | 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.
* add one more signal block for handling '_intmp' (the list of files scheduledderaadt2011-05-251-33/+39
| | | | | to be deleted at termination), and then make the signal handler race safe. ok nicm
* whining verboten; ok deraadtmikeb2010-10-221-8/+1
|
* Fix three bugs in man(1):schwarze2010-03-191-133/+174
| | | | | | | | | | | | | | | | | | | | * 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@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-15/+1
| | | | | | | 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
* make -S case insensitive; this avoids any confusion over the factjmc2008-12-301-3/+6
| | | | | | | that MD page headers use mixed case; tidy up the man page regarding this; diff from Ingo Schwarze ok sobrado millert krw
* -k and -f accept multiple arguments; from Pierre Riteaujmc2008-01-041-4/+4
|
* the ellipsis is not an optional argument; while here, sync the usagesobrado2007-08-061-3/+3
| | | | | | | | and synopsis of commands lots of good ideas by jmc@ ok jmc@
* make jmc happy by somewhat smarter synopsis scanning code for -h; okotto2007-06-041-8/+19
| | | | jaredy@
* fix usagederaadt2007-01-091-4/+4
|
* Coverity CID 2996: Don't return without closing fp.jasper2006-12-141-3/+5
| | | | | | Fix from christos NetBSD. ok otto@, millert@ (earlier version)
* use asprintf instead; dhill@mindcry.orgderaadt2005-11-121-7/+4
|
* Rewrite -m processing to not use queue internals and make it moreotto2005-10-311-18/+8
| | | | simple as well. ok hshoexer@ jaredy@ henning@
* Use queue macros instead of directly accessing fields. ok pat@ "put itotto2005-10-171-29/+27
| | | | in" deraadt@
* - mark up punctuationjmc2004-02-231-4/+5
| | | | | | - use more suitable macros where necessary - a little grammar - sort options and sync usage() (last part checked by henning)
* Support MANPAGER environment variable plus some KNF I had in my tree.millert2003-12-161-4/+7
| | | | Closes PR 3563
* mostly ansi cleanup; pval okderaadt2003-06-101-6/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* lots of sprintf -> snprintf and strcpy -> strlcpy; checked by teduderaadt2003-03-131-5/+6
|
* GNU semantics say that if optstring begins with '-' thenmillert2002-12-081-3/+3
| | | | | | | | | | | | 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.
* let comment match reality. ok millert@espie2002-11-231-4/+4
|
* ansideraadt2002-09-171-26/+25
|
* 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.millert2002-02-161-11/+11
|
* make signal handler safe, by blocking signals around the things that it cares about; millert okderaadt2001-11-171-3/+17
|
* whack strcpyderaadt2001-08-181-3/+3
|
* space police + pet peevesmillert2001-04-101-19/+23
| | | | | use memcpy() not memmove() when we don't care about overlapping segments use puts(foo) instead of print("%s\n", foo)
* KNFderaadt2001-01-311-5/+8
|
* Add a help(1) man page -- help for new users and administrators.aaron1999-10-181-3/+3
|
* clarifyderaadt1999-07-281-3/+3
|
* Handle PAGER in a manner consistent with the Single Unix Specification:pjanzen1999-06-101-3/+3
| | | | | that is, use PAGER rather than "more" if it is defined and non-null, not just if it is defined.
* off by one string termination; wsanchezderaadt1998-11-161-3/+3
|
* /usr/bin/help == man man"deraadt1998-09-141-2/+12
|
* finish off fixing PR 536 completelyderaadt1998-07-201-2/+4
|
* Fix confusing error messageespie1998-07-011-4/+9
|
* fix usagemillert1998-04-251-4/+6
|
* Add -s section for svr4 compat and -S subsection ala:millert1998-03-091-9/+20
| | | | man -s 4 -S alpha scc
* path buf too small; tron@lyssa.owl.dederaadt1997-09-101-3/+3
|
* getopt(3) returns -1 when out of args, not EOF, whee!millert1997-01-151-3/+3
|
* _PATH_TMP -> _PATH_TMPFILE; avoid /tmp//fooXXXX where possible tooderaadt1996-09-161-4/+4
|
* bugfix, paths added with -w should now be searched in the same ordermichaels1996-07-181-6/+16
| | | | as the rest, and not in reverse.
* rcsidderaadt1996-06-261-1/+2
|
* initial import of NetBSD treederaadt1995-10-181-0/+741