=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.383 retrieving revision 1.386 diff -u -p -r1.383 -r1.386 --- mandoc/mdoc_validate.c 2020/04/06 10:16:17 1.383 +++ mandoc/mdoc_validate.c 2020/04/24 12:02:33 1.386 @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.383 2020/04/06 10:16:17 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.386 2020/04/24 12:02:33 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons @@ -37,11 +37,11 @@ #include "mandoc.h" #include "mandoc_xr.h" #include "roff.h" -#include "tag.h" #include "mdoc.h" #include "libmandoc.h" #include "roff_int.h" #include "libmdoc.h" +#include "tag.h" /* FIXME: .Bl -diag can't have non-text children in HEAD. */ @@ -2212,8 +2212,8 @@ post_hyph(POST_ARGS) if (*cp == '-' && isalpha((unsigned char)cp[-1]) && isalpha((unsigned char)cp[1])) { - if (n->string == NULL && n->flags & NODE_ID) - n->string = mandoc_strdup(nch->string); + if (n->tag == NULL && n->flags & NODE_ID) + n->tag = mandoc_strdup(nch->string); *cp = ASCII_HYPH; } } @@ -2765,8 +2765,14 @@ post_dt(POST_ARGS) mandoc_msg(MANDOCERR_MSEC_BAD, nn->line, nn->pos, "Dt ... %s", nn->string); mdoc->meta.vol = mandoc_strdup(nn->string); - } else + } else { mdoc->meta.vol = mandoc_strdup(cp); + if (mdoc->filesec != '\0' && + mdoc->filesec != *nn->string && + *nn->string >= '1' && *nn->string <= '9') + mandoc_msg(MANDOCERR_MSEC_FILE, nn->line, nn->pos, + "*.%c vs Dt ... %c", mdoc->filesec, *nn->string); + } /* Optional third argument: architecture. */