summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-02 21:18:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-02 21:18:29 +0000
commitc3e510863e8794c67068a3e8afc61d9af760144f (patch)
treec51c4ef2405e36271fa26e84842be37963998a4f /main.c
parent9a0fd61677909a43ee8a1f7d69598769f9a7ad6b (diff)
downloadmandoc-c3e510863e8794c67068a3e8afc61d9af760144f.tar.gz
If a single page references the same non-existent manual more than
once, print "(N times)" after the message "referenced manual not found", to lessen the risk that people fix the first instance and miss the others; jmc@ confirmed that this is useful.
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index 03825c4f..9d6db883 100644
--- a/main.c
+++ b/main.c
@@ -844,7 +844,11 @@ check_xr(const char *file)
continue;
if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz))
continue;
- mandoc_asprintf(&cp, "Xr %s %s", xr->name, xr->sec);
+ if (xr->count == 1)
+ mandoc_asprintf(&cp, "Xr %s %s", xr->name, xr->sec);
+ else
+ mandoc_asprintf(&cp, "Xr %s %s (%d times)",
+ xr->name, xr->sec, xr->count);
mmsg(MANDOCERR_XR_BAD, MANDOCLEVEL_STYLE,
file, xr->line, xr->pos + 1, cp);
free(cp);