From ec4aa33aa49344c12ff324f27bb68a147a21623e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 2 Jul 2017 21:18:29 +0000 Subject: 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. --- mandoc_xr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mandoc_xr.c') diff --git a/mandoc_xr.c b/mandoc_xr.c index f6cb46d4..da0a7f0c 100644 --- a/mandoc_xr.c +++ b/mandoc_xr.c @@ -1,4 +1,4 @@ -/* $Id: mandoc_xr.c,v 1.2 2017/07/02 15:31:59 schwarze Exp $ */ +/* $Id: mandoc_xr.c,v 1.3 2017/07/02 21:18:29 schwarze Exp $ */ /* * Copyright (c) 2017 Ingo Schwarze * @@ -81,6 +81,7 @@ mandoc_xr_add(const char *sec, const char *name, int line, int pos) xr->name = xr->hashkey + ssz; xr->line = line; xr->pos = pos; + xr->count = 1; memcpy(xr->sec, sec, ssz); memcpy(xr->name, name, nsz); @@ -97,6 +98,7 @@ mandoc_xr_add(const char *sec, const char *name, int line, int pos) return 0; } + oxr->count++; ret = (oxr->line == -1) ^ (xr->line == -1); if (xr->line == -1) oxr->line = -1; -- cgit v1.2.3-56-ge451