diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-01 09:47:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-01 09:47:30 +0000 |
commit | a288316b2989716c6f4ed17dce8e778e9b6de9d7 (patch) | |
tree | fd723758e0cdfb5ee949c3eceaa129843f13d59b /mdoc_validate.c | |
parent | 17984e1e0b09558f8bfb0a8ee9e49bc97e4a554e (diff) | |
download | mandoc-a288316b2989716c6f4ed17dce8e778e9b6de9d7.tar.gz |
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.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index ceaaed7d..a15ce33e 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -33,6 +33,7 @@ #include "mandoc_aux.h" #include "mandoc.h" +#include "mandoc_xr.h" #include "roff.h" #include "mdoc.h" #include "libmandoc.h" @@ -2336,8 +2337,11 @@ post_xr(POST_ARGS) if (nch->next == NULL) { mandoc_vmsg(MANDOCERR_XR_NOSEC, mdoc->parse, n->line, n->pos, "Xr %s", nch->string); - } else + } else { assert(nch->next == n->last); + mandoc_xr_add(nch->next->string, nch->string, + nch->line, nch->pos); + } post_delim(mdoc); } |