aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitec4aa33aa49344c12ff324f27bb68a147a21623e (patch)
tree03ab3cef63acc0d53aadd0edbdb78d211819addd /main.c
parente5501471e172d4f6de0c3e4afca1fffb5cc93ea7 (diff)
downloadmandoc-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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 2c289e4a..cac2fe49 100644
--- a/main.c
+++ b/main.c
@@ -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);