aboutsummaryrefslogtreecommitdiffstatshomepage
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
commite5501471e172d4f6de0c3e4afca1fffb5cc93ea7 (patch)
tree050e48715fe221def4dff8fb7079f2a07fa7e9fd /main.c
parent2a02f7a0af4b53898861601ef0745e74f3966315 (diff)
downloadmandoc-e5501471e172d4f6de0c3e4afca1fffb5cc93ea7.tar.gz
mandoc-e5501471e172d4f6de0c3e4afca1fffb5cc93ea7.tar.zst
mandoc-e5501471e172d4f6de0c3e4afca1fffb5cc93ea7.zip
add warning "cross reference to self"; inspired by mdoclint
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main.c b/main.c
index df0cdabe..2c289e4a 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.296 2017/07/01 12:54:07 schwarze Exp $ */
+/* $Id: main.c,v 1.297 2017/07/02 15:31:59 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;