diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-12 20:30:35 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-12 20:30:35 +0000 |
commit | f73e57538b043ce8b2e27e9f5acc7d95ea3e332f (patch) | |
tree | 2da0361b57d2b7e86cf6b4cba8bd38d377e687a0 /mdoc_action.c | |
parent | f564800eb22e4968fd18f741ca173e45ff1c8f93 (diff) | |
download | mandoc-f73e57538b043ce8b2e27e9f5acc7d95ea3e332f.tar.gz |
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.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mdoc_action.c b/mdoc_action.c index 5c880e2f..3da58be7 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -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; |