summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/manpath.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix a regression caused by the insertion of two new tokens,schwarze2020-08-271-10/+18
| | | | | | which unintentionally made the -O tag= argument mandatory, breaking commands like "man -akO tag Ic=ulimit". Noticed while answering questions from Ian Ropers.
* undocumented options -O outfilename and -O tagfilenameschwarze2020-07-211-7/+22
| | | | | to support regression testing without a tty; no user visible change intended
* Finally delete support for the "_whatdb" configuration directive,schwarze2020-02-101-9/+2
| | | | | which has a misleading syntax. It was declared obsolete and superseded by the "manpath" directive five years ago.
* Some time ago, i simplified mandoc_msg() such that it can be usedschwarze2019-07-101-42/+48
| | | | | | | | | everywhere and not only in the parsers. For more uniform messages, use it at more places instead of err(3), in particular in the main program. While here, integrate a few trivial functions called at exactly one place into the main option parser, and let a few more functions use the normal convention of returning 0 for success and -1 for error.
* avoid duplicate "bad argument" error message, also shortening the codeschwarze2019-05-031-3/+2
|
* When processing unknown output options, prevent passing NULL to printf.anton2019-05-031-3/+4
| | | | ok schwarze@
* In -T locale (the default), -T ascii, and -T utf8 mode, provide a newschwarze2018-11-221-7/+14
| | | | | | | | | | | | | | | output option -O tag[=term] to move right to the definition of "term" when opening the manual page in a pager, effectively porting the -T html fragment name feature - https://man.openbsd.org/ksh#ulimit - to the terminal. Try: $ man -O tag uvm_sysctl $ man -O tag=ulimit ksh $ man -O tag 3 compress Feature development triggered by a question from kn@. Klemens also tested, provided feedback that resulted in improvements, and provided an OK.
* Add an option -T html -O toc to add a brief table of contents nearschwarze2018-10-021-3/+6
| | | | | the top of HTML pages containing at least two non-standard sections. Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.
* Basic reporting of .Xrs to manual pages that don't existschwarze2017-07-011-1/+9
| | | | | | | | | | | | in the base system, inspired by mdoclint(1). We are able to do this because (1) the -mdoc parser, the -Tlint validator, and the man(1) manual page lookup code are all in the same program and (2) the mandoc.db(5) database format allows fast lookup. Feedback from, previous versions tested by, and OK jmc@. A few features will be added to this in the tree, step by step.
* Delete the arbitrary range restriction for -Owidth.schwarze2017-06-131-2/+2
| | | | | | | We provide users with tools. We don't attempt to prevent them from using them in stupid ways: depending on the context, not every stupid-looking use is necessarily actually stupid, and not every stupidity can be automatically detected anyway, so don't even try.
* In -Ttree output mode, show the BROKEN node flag andschwarze2017-02-101-2/+5
| | | | provide a -Onoval output option to show the unvalidated tree.
* warn about invalid output optionsschwarze2017-01-271-29/+68
| | | | | and error out if they occur on the command line; missing feature found in the TODO file
* Trim trailing whitespace from man.conf lines. OK schwarze@.millert2016-05-231-6/+5
|
* Modernization, no functional change intended:schwarze2015-11-071-10/+16
| | | | | Use the POSIX function getline(3) rather than the slightly dangerous BSD function fgetln(3).
* Finally use __progname, err(3) and warn(3).schwarze2015-10-111-9/+6
| | | | | | | | | | | | | That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It also shortens the code by 50 lines. It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, it's the job of the portable distribution to provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. Actually, the compat code for the portable distribution already exists and will be committed right after this.
* Do not let the -m option or MANPATH with leading, trailing, or doubleschwarze2015-05-071-6/+8
| | | | | | | | | colon override the default manpath, let them add to the default manpath. Only override the default manpath by the -M option, by MANPATH without leading, trailing, or double colon, or by "manpath" in man.conf(5). Problem reported by Jan Stary <hans at stare dot cz>. Patch OK'ed by millert@.
* Parse the new man.conf(5) "output" directive.schwarze2015-03-271-25/+96
| | | | The next step will be to actually use the parsed data.
* Add a new directive "manpath path"schwarze2015-03-261-26/+42
| | | | | | to replace the legacy "_whatdb path/whatis.db". Keep _whatdb support for backward compat, for now. Discussed with many, jmc@ and ajacoutot@ agree with the general direction.
* when there is no -m, no -M, no MANPATH and no /etc/man.conf,schwarze2015-03-211-2/+6
| | | | fall back to /usr/share/man:/usr/X11R6/man:/usr/local/man
* Ignore invalid directories in man.conf(5) and MANPATH, even if theirschwarze2014-11-181-16/+32
| | | | | | parent directories exist, but complain about invalid directories given on the command line. Intended to fix an oddity reported by sthen@.
* Audit malloc(3)/calloc(3)/realloc(3) usage.schwarze2014-04-231-3/+3
| | | | | | | * Change eight reallocs to reallocarray to be safe from overflows. * Change one malloc to reallocarray to be safe from overflows. * Change one calloc to reallocarray, no zeroing needed. * Change the order of arguments of three callocs (aesthetical).
* KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */,schwarze2014-04-201-4/+3
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* The files mandoc.c and mandoc.h contained both specialised low-levelschwarze2014-03-211-2/+2
| | | | | | | functions used for multiple languages (mdoc, man, roff), for example mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary functions. Split the auxiliaries out into their own file and header. While here, do some #include cleanup.
* My audit of mandoc revealed two missing (unsigned char) castsschwarze2013-11-211-2/+2
| | | | | in isspace() and tolower() arguments containing arbitrary char data. Thanks to deraadt@ for triggering the audit.
* Trivial sync to bsd.lv:schwarze2013-05-291-5/+5
| | | | | Kristaps changed the size member of struct manpaths from int to size_t. No functional change.
* remove some unnecessary sys/param.h inclusionsderaadt2012-12-041-3/+1
|
* Support leading, trailing and double colons in MANPATHschwarze2011-12-241-6/+44
| | | | | | to prepend, append or insert the man.conf(5) default path; compatible with GNU manpath(1), implementation by kristaps@, heavily tweaked by me.
* Improvements from kristaps@:schwarze2011-12-191-11/+6
| | | | | | | | | | (1) Make the database format simpler and smaller by - storing the file type as a single character and - storing paths relative to the dir containing the database. The latter allows to move trees around. Both together typically save 15-25% of the index size. (2) Make sure apropos(1) "any" really covers all search keys. (3) Make manpath_parseline() static, drop manpath_parseconf() completely.
* implement -C (alternative config file) for apropos(1) and mandocdb(8);schwarze2011-12-121-6/+7
| | | | ok kristaps@
* Resync to bsd.lv, most code from kristaps@.schwarze2011-11-261-0/+141
In particular, support the MANPATH environment variable and don't confuse index record numbers when working with multiple mandoc databases at once. Besides, remove lots of gratuitious code and whitespace differences.