aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-05 15:17:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-05 15:17:32 +0000
commitac714e0488d7c68718c62be1daa50511092a070d (patch)
tree23603ba00471fb588afdd3b7c5765fab62424249 /mdoc_man.c
parent264209da4a75cf323caf3e1a5e89534f15086b73 (diff)
downloadmandoc-ac714e0488d7c68718c62be1daa50511092a070d.tar.gz
mandoc-ac714e0488d7c68718c62be1daa50511092a070d.tar.zst
mandoc-ac714e0488d7c68718c62be1daa50511092a070d.zip
Move .sp to the roff modules. Enough infrastructure is in place
now that this actually saves code: -70 LOC.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 61b4c870..04e9c8d8 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.112 2017/05/05 13:17:55 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.113 2017/05/05 15:17:32 schwarze Exp $ */
/*
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -73,7 +73,6 @@ static void post_nm(DECL_ARGS);
static void post_percent(DECL_ARGS);
static void post_pf(DECL_ARGS);
static void post_sect(DECL_ARGS);
-static void post_sp(DECL_ARGS);
static void post_vt(DECL_ARGS);
static int pre__t(DECL_ARGS);
static int pre_an(DECL_ARGS);
@@ -109,7 +108,7 @@ static int pre_ns(DECL_ARGS);
static int pre_pp(DECL_ARGS);
static int pre_rs(DECL_ARGS);
static int pre_sm(DECL_ARGS);
-static int pre_sp(DECL_ARGS);
+static void pre_sp(DECL_ARGS);
static int pre_sect(DECL_ARGS);
static int pre_sy(DECL_ARGS);
static void pre_syn(const struct roff_node *);
@@ -128,6 +127,7 @@ static const void_fp roff_manacts[ROFF_MAX] = {
pre_br,
pre_ft,
pre_ll,
+ pre_sp,
};
static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
@@ -249,7 +249,6 @@ static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
{ cond_body, pre_en, post_en, NULL, NULL }, /* En */
{ NULL, NULL, NULL, NULL, NULL }, /* Dx */
{ NULL, NULL, post_percent, NULL, NULL }, /* %Q */
- { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */
{ NULL, NULL, post_percent, NULL, NULL }, /* %U */
{ NULL, NULL, NULL, NULL, NULL }, /* Ta */
};
@@ -1694,22 +1693,17 @@ pre_sm(DECL_ARGS)
return 0;
}
-static int
+static void
pre_sp(DECL_ARGS)
{
-
- if (MMAN_PP & outflags) {
+ if (outflags & MMAN_PP) {
outflags &= ~MMAN_PP;
print_line(".PP", 0);
- } else
+ } else {
print_line(".sp", 0);
- return 1;
-}
-
-static void
-post_sp(DECL_ARGS)
-{
-
+ if (n->child != NULL)
+ print_word(n->child->string);
+ }
outflags |= MMAN_nl;
}