version 1.387, 2020/04/26 21:41:07 |
version 1.391, 2022/06/08 16:31:46 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2010-2020 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010-2021 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org> |
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org> |
* |
* |
Line 164 static const v_post mdoc_valids[MDOC_MAX - MDOC_Dd] = |
|
Line 164 static const v_post mdoc_valids[MDOC_MAX - MDOC_Dd] = |
|
post_defaults, /* Pa */ |
post_defaults, /* Pa */ |
post_rv, /* Rv */ |
post_rv, /* Rv */ |
post_st, /* St */ |
post_st, /* St */ |
post_delim_nb, /* Va */ |
post_tag, /* Va */ |
post_delim_nb, /* Vt */ |
post_delim_nb, /* Vt */ |
post_xr, /* Xr */ |
post_xr, /* Xr */ |
NULL, /* %A */ |
NULL, /* %A */ |
Line 1113 post_tg(POST_ARGS) |
|
Line 1113 post_tg(POST_ARGS) |
|
/* Find the next node. */ |
/* Find the next node. */ |
n = mdoc->last; |
n = mdoc->last; |
for (nn = n; nn != NULL; nn = nn->parent) { |
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; |
nn = nn->next; |
break; |
break; |
} |
} |
Line 2617 post_section(POST_ARGS) |
|
Line 2618 post_section(POST_ARGS) |
|
if ((nch = n->child) != NULL && |
if ((nch = n->child) != NULL && |
nch->type == ROFFT_TEXT && |
nch->type == ROFFT_TEXT && |
strcmp(nch->string, tag) == 0) |
strcmp(nch->string, tag) == 0) |
tag_put(NULL, TAG_WEAK, n); |
tag_put(NULL, TAG_STRONG, n); |
else |
else |
tag_put(tag, TAG_FALLBACK, n); |
tag_put(tag, TAG_FALLBACK, n); |
free(tag); |
free(tag); |
Line 2872 post_os(POST_ARGS) |
|
Line 2873 post_os(POST_ARGS) |
|
{ |
{ |
#ifndef OSNAME |
#ifndef OSNAME |
struct utsname utsname; |
struct utsname utsname; |
static char *defbuf; |
|
#endif |
#endif |
struct roff_node *n; |
struct roff_node *n; |
|
|
Line 2909 post_os(POST_ARGS) |
|
Line 2909 post_os(POST_ARGS) |
|
#ifdef OSNAME |
#ifdef OSNAME |
mdoc->meta.os = mandoc_strdup(OSNAME); |
mdoc->meta.os = mandoc_strdup(OSNAME); |
#else /*!OSNAME */ |
#else /*!OSNAME */ |
if (defbuf == NULL) { |
if (mdoc->os_r == NULL) { |
if (uname(&utsname) == -1) { |
if (uname(&utsname) == -1) { |
mandoc_msg(MANDOCERR_OS_UNAME, n->line, n->pos, "Os"); |
mandoc_msg(MANDOCERR_OS_UNAME, n->line, n->pos, "Os"); |
defbuf = mandoc_strdup("UNKNOWN"); |
mdoc->os_r = mandoc_strdup("UNKNOWN"); |
} else |
} else |
mandoc_asprintf(&defbuf, "%s %s", |
mandoc_asprintf(&mdoc->os_r, "%s %s", |
utsname.sysname, utsname.release); |
utsname.sysname, utsname.release); |
} |
} |
mdoc->meta.os = mandoc_strdup(defbuf); |
mdoc->meta.os = mandoc_strdup(mdoc->os_r); |
#endif /*!OSNAME*/ |
#endif /*!OSNAME*/ |
|
|
out: |
out: |