summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-02 15:31:59 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-02 15:31:59 +0000
commit9a0fd61677909a43ee8a1f7d69598769f9a7ad6b (patch)
treeff9b788408b481515dd3eae168a45e4aea03416d /main.c
parent58be69d2a5cab3e51bf16a2880fbfa2115dad47d (diff)
downloadmandoc-9a0fd61677909a43ee8a1f7d69598769f9a7ad6b.tar.gz
add warning "cross reference to self"; inspired by mdoclint
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index bd994427..03825c4f 100644
--- a/main.c
+++ b/main.c
@@ -763,8 +763,7 @@ parse(struct curparse *curp, int fd, const char *file)
if (man == NULL)
return;
- if (curp->mmin < MANDOCERR_STYLE)
- mandoc_xr_reset();
+ mandoc_xr_reset();
if (man->macroset == MACROSET_MDOC) {
if (curp->outtype != OUTT_TREE || !curp->outopts->noval)
mdoc_validate(man);
@@ -816,7 +815,8 @@ parse(struct curparse *curp, int fd, const char *file)
break;
}
}
- check_xr(file);
+ if (curp->mmin < MANDOCERR_STYLE)
+ check_xr(file);
mparse_updaterc(curp->mp, &rc);
}
@@ -833,6 +833,8 @@ check_xr(const char *file)
manpath_base(&paths);
for (xr = mandoc_xr_get(); xr != NULL; xr = xr->next) {
+ if (xr->line == -1)
+ continue;
search.arch = NULL;
search.sec = xr->sec;
search.outkey = NULL;