diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-12 12:38:01 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-12 12:38:01 +0000 |
commit | ff7b52fc598055387eeb90035e1d6418b43d3c27 (patch) | |
tree | f4e4aac93954ad8c23c1b825da4207d9a3e82cd7 /mdoc_action.c | |
parent | ba4734a53e665e8062edb5784cf988d13c6ee165 (diff) | |
download | mandoc-ff7b52fc598055387eeb90035e1d6418b43d3c27.tar.gz |
Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaults
to 6n if no value is specified" and added regression tests for `Bl'
testing against the empty -offset argument.
Diffstat (limited to 'mdoc_action.c')
-rw-r--r-- | mdoc_action.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/mdoc_action.c b/mdoc_action.c index 21cc2c1d..197115c9 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -68,9 +68,7 @@ static int post_st(POST_ARGS); static int post_std(POST_ARGS); static int pre_bd(PRE_ARGS); -static int pre_bl(PRE_ARGS); static int pre_dl(PRE_ARGS); -static int pre_offset(PRE_ARGS); static const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Ap */ @@ -84,7 +82,7 @@ static const struct actions mdoc_actions[MDOC_MAX] = { { pre_dl, post_display }, /* Dl */ { pre_bd, post_display }, /* Bd */ { NULL, NULL }, /* Ed */ - { pre_bl, post_bl }, /* Bl */ + { NULL, post_bl }, /* Bl */ { NULL, NULL }, /* El */ { NULL, NULL }, /* It */ { NULL, NULL }, /* Ad */ @@ -937,44 +935,6 @@ pre_dl(PRE_ARGS) } -/* ARGSUSED */ -static int -pre_offset(PRE_ARGS) -{ - int i; - - /* - * Make sure that an empty offset produces an 8n length space as - * stipulated by mdoc.samples. - */ - - for (i = 0; n->args && i < (int)n->args->argc; i++) { - if (MDOC_Offset != n->args->argv[i].arg) - continue; - if (n->args->argv[i].sz) - break; - assert(1 == n->args->refcnt); - /* If no value set, length of <string>. */ - n->args->argv[i].sz++; - n->args->argv[i].value = mandoc_malloc(sizeof(char *)); - n->args->argv[i].value[0] = mandoc_strdup("8n"); - break; - } - - return(1); -} - - -static int -pre_bl(PRE_ARGS) -{ - - if (MDOC_BLOCK == n->type) - return(pre_offset(m, n)); - return(1); -} - - static int pre_bd(PRE_ARGS) { |