aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/man_validate.c b/man_validate.c
index 0c2ed8a4..ee634f50 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.151 2020/03/13 15:32:28 schwarze Exp $ */
+/* $Id: man_validate.c,v 1.152 2020/04/04 20:33:33 schwarze Exp $ */
/*
* Copyright (c) 2010, 2012-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -311,9 +311,32 @@ static void
post_SH(CHKARGS)
{
struct roff_node *nc;
+ char *cp, *tag;
- if (n->type != ROFFT_BODY || (nc = n->child) == NULL)
+ nc = n->child;
+ switch (n->type) {
+ case ROFFT_HEAD:
+ tag = NULL;
+ deroff(&tag, n);
+ if (tag != NULL) {
+ for (cp = tag; *cp != '\0'; cp++)
+ if (*cp == ' ')
+ *cp = '_';
+ if (nc != NULL && nc->type == ROFFT_TEXT &&
+ strcmp(nc->string, tag) == 0)
+ tag_put(NULL, TAG_WEAK, n);
+ else
+ tag_put(tag, TAG_FALLBACK, n);
+ free(tag);
+ }
+ return;
+ case ROFFT_BODY:
+ if (nc != NULL)
+ break;
return;
+ default:
+ return;
+ }
if (nc->tok == MAN_PP && nc->body->child != NULL) {
while (nc->body->last != NULL) {