aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-12 20:30:35 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-12 20:30:35 +0000
commit9d568b7d9d058612eaec8cbbc8a2161cd895aa1a (patch)
tree2e1d7276ed0e822ac0df63676947fa8ad1f5816e /mdoc_action.c
parentf3e14f7db517bde63e7c9d721ed20dd06b251e75 (diff)
downloadmandoc-9d568b7d9d058612eaec8cbbc8a2161cd895aa1a.tar.gz
mandoc-9d568b7d9d058612eaec8cbbc8a2161cd895aa1a.tar.zst
mandoc-9d568b7d9d058612eaec8cbbc8a2161cd895aa1a.zip
Moved mdoc_a2st() out of mdoc.h -> libmdoc.h (replacement in mdoc_action.c).
Made bad standards into an error (were a warning).
Diffstat (limited to 'mdoc_action.c')
-rw-r--r--mdoc_action.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index 176dd195..30a75852 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.25 2009/07/12 20:24:24 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.26 2009/07/12 20:30:35 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -46,6 +46,7 @@ static int post_nm(POST_ARGS);
static int post_os(POST_ARGS);
static int post_prol(POST_ARGS);
static int post_sh(POST_ARGS);
+static int post_st(POST_ARGS);
static int post_std(POST_ARGS);
static int pre_bd(PRE_ARGS);
@@ -89,7 +90,7 @@ const struct actions mdoc_actions[MDOC_MAX] = {
{ NULL, NULL }, /* Ot */
{ NULL, NULL }, /* Pa */
{ NULL, post_std }, /* Rv */
- { NULL, NULL }, /* St */
+ { NULL, post_st }, /* St */
{ NULL, NULL }, /* Va */
{ NULL, NULL }, /* Vt */
{ NULL, NULL }, /* Xr */
@@ -290,6 +291,22 @@ post_nm(POST_ARGS)
static int
+post_st(POST_ARGS)
+{
+ const char *p;
+
+ assert(MDOC_TEXT == m->last->child->type);
+ p = mdoc_a2st(m->last->child->string);
+ assert(p);
+ free(m->last->child->string);
+ m->last->child->string = strdup(p);
+ if (NULL == m->last->child->string)
+ return(mdoc_nerr(m, m->last, EMALLOC));
+ return(1);
+}
+
+
+static int
post_at(POST_ARGS)
{
struct mdoc_node *n;