=================================================================== RCS file: /cvs/mandoc/mandoc_xr.c,v retrieving revision 1.2 retrieving revision 1.4 diff -u -p -r1.2 -r1.4 --- mandoc/mandoc_xr.c 2017/07/02 15:31:59 1.2 +++ mandoc/mandoc_xr.c 2020/06/22 19:20:40 1.4 @@ -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.4 2020/06/22 19:20:40 schwarze Exp $ */ /* * Copyright (c) 2017 Ingo Schwarze * @@ -14,6 +14,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include @@ -81,6 +83,7 @@ mandoc_xr_add(const char *sec, const char *name, int l 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 +100,7 @@ mandoc_xr_add(const char *sec, const char *name, int l return 0; } + oxr->count++; ret = (oxr->line == -1) ^ (xr->line == -1); if (xr->line == -1) oxr->line = -1;