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 | ec4aa33aa49344c12ff324f27bb68a147a21623e (patch) | |
tree | 03ab3cef63acc0d53aadd0edbdb78d211819addd /main.c | |
parent | e5501471e172d4f6de0c3e4afca1fffb5cc93ea7 (diff) | |
download | mandoc-ec4aa33aa49344c12ff324f27bb68a147a21623e.tar.gz mandoc-ec4aa33aa49344c12ff324f27bb68a147a21623e.tar.zst mandoc-ec4aa33aa49344c12ff324f27bb68a147a21623e.zip |
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 | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.297 2017/07/02 15:31:59 schwarze Exp $ */ +/* $Id: main.c,v 1.298 2017/07/02 21:18:29 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org> @@ -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); |