CVS log for mandoc/manpath.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.44 / (download) - annotate - [select for diffs], Fri Nov 5 18:03:08 2021 UTC (4 weeks, 3 days ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.43: +37 -48 lines
Diff to previous 1.43 (colored) to selected 1.38 (colored)

Make sure that the configuration file is always read, even when
running with the -M option or with a MANPATH environment variable
that has neither a leading or trailing ":" nor any "::".  If -M or
MANPATH override the configuration file rather than adding to it,
just ignore any "manpath" directives while processing the configuration
file.

This fixes a bug reported by Jan Stary <hans at stare dot cz>
on misc@.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Aug 27 14:59:47 2020 UTC (15 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.42: +18 -10 lines
Diff to previous 1.42 (colored) to selected 1.38 (colored)

Fix a regression caused by the insertion of two new tokens,
which unintentionally made the -O tag= argument mandatory,
breaking commands like "man -akO tag Ic=ulimit".
Noticed while answering questions from Ian Ropers.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jul 21 15:10:01 2020 UTC (16 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.41: +22 -7 lines
Diff to previous 1.41 (colored) to selected 1.38 (colored)

undocumented options -O outfilename and -O tagfilename
to support regression testing without a tty;
no user visible change intended

Revision 1.41 / (download) - annotate - [select for diffs], Mon Feb 10 14:42:10 2020 UTC (21 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.40: +2 -9 lines
Diff to previous 1.40 (colored) to selected 1.38 (colored)

Finally delete support for the "_whatdb" configuration directive,
which has a misleading syntax.  It was declared obsolete and
superseded by the "manpath" directive five years ago.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jul 10 19:39:01 2019 UTC (2 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +48 -44 lines
Diff to previous 1.39 (colored) to selected 1.38 (colored)

Some time ago, i simplified mandoc_msg() such that it can be used
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.

Revision 1.39 / (download) - annotate - [select for diffs], Fri May 3 18:39:34 2019 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +2 -3 lines
Diff to previous 1.38 (colored)

avoid duplicate "bad argument" error message, also shortening the code

Revision 1.38 / (download) - annotate - [selected], Fri May 3 18:23:53 2019 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +4 -3 lines
Diff to previous 1.37 (colored)

when processing unknown output options, prevent passing NULL to printf;
patch from anton@

Revision 1.37 / (download) - annotate - [select for diffs], Thu Nov 22 11:30:23 2018 UTC (3 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.36: +14 -7 lines
Diff to previous 1.36 (colored) to selected 1.38 (colored)

In -T locale (the default), -T ascii, and -T utf8 mode, provide a new
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.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Oct 2 14:56:47 2018 UTC (3 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +6 -3 lines
Diff to previous 1.35 (colored) to selected 1.38 (colored)

Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jul 1 09:47:30 2017 UTC (4 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3, VERSION_1_14_2
Changes since 1.34: +8 -1 lines
Diff to previous 1.34 (colored) to selected 1.38 (colored)

Basic reporting of .Xrs to manual pages that don't exist
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.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jun 13 15:06:56 2017 UTC (4 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored) to selected 1.38 (colored)

Delete the arbitrary range restriction for -Owidth.
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.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Feb 10 15:45:28 2017 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1
Changes since 1.32: +5 -2 lines
Diff to previous 1.32 (colored) to selected 1.38 (colored)

In -Ttree output mode, show the BROKEN node flag and
provide a -Onoval output option to show the unvalidated tree.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jan 27 13:47:10 2017 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +68 -29 lines
Diff to previous 1.31 (colored) to selected 1.38 (colored)

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jul 19 22:40:33 2016 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +1 -52 lines
Diff to previous 1.30 (colored) to selected 1.38 (colored)

Now that our man.conf(5) format is mature and extremely simple,
delete manpath(1) support.  With the mandoc-based man(1), manpath(1)
is utterly useless.  Just set MANPATH_DEFAULT in configure.local
for sane operating system defaults, use man.conf(5) for machine-
specific modifications, and use ${MANPATH}, -m, and -M for user
preferences.

Revision 1.30 / (download) - annotate - [select for diffs], Sat May 28 13:44:13 2016 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_4
Branch point for: VERSION_1_13
Changes since 1.29: +5 -6 lines
Diff to previous 1.29 (colored) to selected 1.38 (colored)

Trim trailing whitespace from man.conf lines; patch from millert@.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Nov 7 17:58:55 2015 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.28: +16 -10 lines
Diff to previous 1.28 (colored) to selected 1.38 (colored)

Modernization, no functional change intended:
Use the POSIX function getline(3) rather than the slightly
dangerous BSD function fgetln(3).
Remove the related compatibility code.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Nov 7 14:22:29 2015 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored) to selected 1.38 (colored)

Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.
In that case, the required prototypes are in "config.h".
Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Oct 11 21:12:55 2015 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.26: +6 -9 lines
Diff to previous 1.26 (colored) to selected 1.38 (colored)

Finally use __progname, err(3) and warn(3).
That's more readable and less error-prone than fumbling around
with argv[0], fprintf(3), strerror(3), perror(3), and exit(3).

It's a bad idea to boycott good interfaces merely because standards
committees ignore them.  Instead, let's provide compatibility modules
for archaic systems (like commercial Solaris) that still don't have
them.  The compat module has an UCB Copyright (c) 1993...

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jun 10 19:26:13 2015 UTC (6 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +5 -1 lines
Diff to previous 1.25 (colored) to selected 1.38 (colored)

Avoid warning "defined but not used" when compiling with HAVE_MANPATH.
Issue found on Debian by Markus <Waldeck at gmx dot de>.

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 7 12:08:13 2015 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +8 -6 lines
Diff to previous 1.24 (colored) to selected 1.38 (colored)

Do not let the -m option or MANPATH with leading, trailing, or double
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@.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Apr 28 16:13:45 2015 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored) to selected 1.38 (colored)

Fix the HAVE_MANPATH case, got broken in rev. 1.23.
Patch from Steffen Nurpmeso <sdaoden at yandex dot com>, thanks.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Mar 27 17:37:25 2015 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +96 -27 lines
Diff to previous 1.22 (colored) to selected 1.38 (colored)

Parse the new man.conf(5) "output" directive.
The next step will be to actually use the parsed data.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Mar 26 22:42:32 2015 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +42 -26 lines
Diff to previous 1.21 (colored) to selected 1.38 (colored)

Add a new directive "manpath path"
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.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Mar 22 18:14:30 2015 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored) to selected 1.38 (colored)

make MANPATH_DEFAULT compile-time configurable

Revision 1.20 / (download) - annotate - [select for diffs], Sat Mar 21 17:19:36 2015 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +6 -2 lines
Diff to previous 1.19 (colored) to selected 1.38 (colored)

when there is no -m, no -M, no MANPATH and no /etc/man.conf,
fall back to /usr/share/man:/usr/X11R6/man:/usr/local/man

Revision 1.19 / (download) - annotate - [select for diffs], Thu Nov 27 00:30:40 2014 UTC (7 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3, VERSION_1_13_2
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored) to selected 1.38 (colored)

fix build when HAVE_MANPATH is set; patch from <bapt at FreeBSD>

Revision 1.18 / (download) - annotate - [select for diffs], Tue Nov 18 19:41:47 2014 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.17: +31 -16 lines
Diff to previous 1.17 (colored) to selected 1.38 (colored)

Ignore invalid directories in man.conf(5) and MANPATH, even if their
parent directories exist, but complain about invalid directories
given on the command line.
Intended to fix an oddity reported by sthen@.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Aug 16 19:00:01 2014 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored) to selected 1.38 (colored)

Improve build system and autodetection.
* Make ./configure standalone, that's what people expect.
* Let people write a ./configure.local from scratch, not edit existing files.
* Autodetect wchar, sqlite3, and manpath and act accordingly.
* Autodetect the need for -L/usr/local/lib and -lutil.
* Get rid of config.h.p{re,ost}, let ./configure only write what's needed.
* Let ./configure write a Makefile.local snippet, that's quite flexible.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored) to selected 1.38 (colored)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Apr 23 21:06:41 2014 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored) to selected 1.38 (colored)

Audit malloc(3)/calloc(3)/realloc(3) usage.
* 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).

Revision 1.14 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:05 2014 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +3 -4 lines
Diff to previous 1.13 (colored) to selected 1.38 (colored)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 23 11:25:26 2014 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored) to selected 1.38 (colored)

The files mandoc.c and mandoc.h contained both specialised low-level
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.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Nov 21 01:49:18 2013 UTC (8 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored) to selected 1.38 (colored)

My audit of mandoc revealed one missing (unsigned char) cast
in an isspace() argument containing arbitrary char data.
Thanks to deraadt@ for triggering the audit.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jun 5 02:00:26 2013 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_2
Changes since 1.10: +2 -6 lines
Diff to previous 1.10 (colored) to selected 1.38 (colored)

Some places used PATH_MAX from <limits.h>, some MAXPATHLEN from <sys/param.h>.
Consistently use the PATH_MAX since it is specified by POSIX,
while MAXPATHLEN is not.
In preparation for using this at a few more places.

Revision 1.10 / (download) - annotate - [select for diffs], Wed May 29 22:48:10 2013 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +5 -3 lines
Diff to previous 1.9 (colored) to selected 1.38 (colored)

Sync to OpenBSD:
* Guard <sys/param.h> inclusion by #ifdef USE_MANPATH
  to make it more obvious why this isn't needed on OpenBSD.
  Noticed by deraadt@.
* Resolve gratuitious whitespace differences:
  Blanks before tabs and on empty lines.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jun 8 10:32:40 2012 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.8: +6 -6 lines
Diff to previous 1.8 (colored) to selected 1.38 (colored)

Use size_t in manpath instead of int.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 24 22:37:16 2011 UTC (9 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_1
Changes since 1.7: +46 -7 lines
Diff to previous 1.7 (colored) to selected 1.38 (colored)

Support leading, trailing and double colons in MANPATH to prepend,
append or insert the man.conf(5) default path; compatible with GNU
manpath(1), implementation by kristaps@, heavily tweaked by schwarze@.

Updates to MANPATH documentation applied to whatis.1, apropos.1, and
catman.8 also.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 13 21:09:01 2011 UTC (9 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored) to selected 1.38 (colored)

Remove stray warnx() left in the manpath.c code.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Dec 13 20:56:46 2011 UTC (9 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +53 -42 lines
Diff to previous 1.5 (colored) to selected 1.38 (colored)

Have manpath.c properly use manpath(1), that is, using -C and -m and so on.
This also cleans up the code a little bit.  While here, make some functions
static that are only used within manpath.c.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 12 02:00:49 2011 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +7 -6 lines
Diff to previous 1.4 (colored) to selected 1.38 (colored)

implement -C (alternative config file) for apropos(1) and mandocdb(8),
including various tweaks to the whatis(8) manual;
ok kristaps@

Revision 1.4 / (download) - annotate - [select for diffs], Sat Nov 26 22:38:11 2011 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.3: +10 -9 lines
Diff to previous 1.3 (colored) to selected 1.38 (colored)

Sync to OpenBSD, mostly gratuitous and whitespace differences,
but a few serious things as well:
* -M overrides MANPATH
* -m prepends to the path
* put back database close calls that got lost in mandocdb
* missing sys/types.h in manpath.c, needed for size_t
ok kristaps@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Nov 24 10:44:56 2011 UTC (10 years ago) by kristaps
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored) to selected 1.38 (colored)

Allow man.conf file to be assignable.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Nov 24 10:43:55 2011 UTC (10 years ago) by kristaps
Branch: MAIN
Changes since 1.1: +21 -14 lines
Diff to previous 1.1 (colored) to selected 1.38 (colored)

Export the manpath_manconf() function, slightly reorderng manpath.c while
doing so.  This will be used by a jailed man.cgi, as the cache built by
manup(8) creates a man.conf for it to use.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Nov 23 09:47:38 2011 UTC (10 years ago) by kristaps
Branch: MAIN
Diff to selected 1.38 (colored)

Support for Open/NetBSD's /etc/man.conf and others' manpath(1).
Most of this code (except the manpath part) written by schwarze@.
This isn't hooked into anything yet.

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.




CVSweb