=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.387 retrieving revision 1.391 diff -u -p -r1.387 -r1.391 --- mandoc/mdoc_validate.c 2020/04/26 21:41:07 1.387 +++ mandoc/mdoc_validate.c 2022/06/08 16:31:46 1.391 @@ -1,6 +1,6 @@ -/* $Id: mdoc_validate.c,v 1.387 2020/04/26 21:41:07 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.391 2022/06/08 16:31:46 schwarze Exp $ */ /* - * Copyright (c) 2010-2020 Ingo Schwarze + * Copyright (c) 2010-2021 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010 Joerg Sonnenberger * @@ -164,7 +164,7 @@ static const v_post mdoc_valids[MDOC_MAX - MDOC_Dd] = post_defaults, /* Pa */ post_rv, /* Rv */ post_st, /* St */ - post_delim_nb, /* Va */ + post_tag, /* Va */ post_delim_nb, /* Vt */ post_xr, /* Xr */ NULL, /* %A */ @@ -1113,7 +1113,8 @@ post_tg(POST_ARGS) /* Find the next node. */ n = mdoc->last; for (nn = n; nn != NULL; nn = nn->parent) { - if (nn->next != NULL) { + if (nn->type != ROFFT_HEAD && nn->type != ROFFT_BODY && + nn->type != ROFFT_TAIL && nn->next != NULL) { nn = nn->next; break; } @@ -2617,7 +2618,7 @@ post_section(POST_ARGS) if ((nch = n->child) != NULL && nch->type == ROFFT_TEXT && strcmp(nch->string, tag) == 0) - tag_put(NULL, TAG_WEAK, n); + tag_put(NULL, TAG_STRONG, n); else tag_put(tag, TAG_FALLBACK, n); free(tag); @@ -2872,7 +2873,6 @@ post_os(POST_ARGS) { #ifndef OSNAME struct utsname utsname; - static char *defbuf; #endif struct roff_node *n; @@ -2909,15 +2909,15 @@ post_os(POST_ARGS) #ifdef OSNAME mdoc->meta.os = mandoc_strdup(OSNAME); #else /*!OSNAME */ - if (defbuf == NULL) { + if (mdoc->os_r == NULL) { if (uname(&utsname) == -1) { mandoc_msg(MANDOCERR_OS_UNAME, n->line, n->pos, "Os"); - defbuf = mandoc_strdup("UNKNOWN"); + mdoc->os_r = mandoc_strdup("UNKNOWN"); } else - mandoc_asprintf(&defbuf, "%s %s", + mandoc_asprintf(&mdoc->os_r, "%s %s", utsname.sysname, utsname.release); } - mdoc->meta.os = mandoc_strdup(defbuf); + mdoc->meta.os = mandoc_strdup(mdoc->os_r); #endif /*!OSNAME*/ out: