diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-02 21:18:29 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-02 21:18:29 +0000 |
commit | c3e510863e8794c67068a3e8afc61d9af760144f (patch) | |
tree | c51c4ef2405e36271fa26e84842be37963998a4f /main.c | |
parent | 9a0fd61677909a43ee8a1f7d69598769f9a7ad6b (diff) | |
download | mandoc-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |