summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_man.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-05-05 15:16:25 +0000
committerschwarze <schwarze@openbsd.org>2017-05-05 15:16:25 +0000
commit6561cb236ca8d6ce04d90c88a7bf8b7d5848f466 (patch)
tree4ad83851593a955661527309d25c26aabb32d005 /usr.bin/mandoc/mdoc_man.c
parentImplement two quirks to support the Arasan eMMC 5.1 controller found on (diff)
downloadwireguard-openbsd-6561cb236ca8d6ce04d90c88a7bf8b7d5848f466.tar.xz
wireguard-openbsd-6561cb236ca8d6ce04d90c88a7bf8b7d5848f466.zip
Move .sp to the roff modules. Enough infrastructure is in place
now that this actually saves code: -70 LOC.
Diffstat (limited to 'usr.bin/mandoc/mdoc_man.c')
-rw-r--r--usr.bin/mandoc/mdoc_man.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c
index 2134b41336e..b8bc11bff4d 100644
--- a/usr.bin/mandoc/mdoc_man.c
+++ b/usr.bin/mandoc/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_man.c,v 1.110 2017/05/05 13:17:04 schwarze Exp $ */
+/* $OpenBSD: mdoc_man.c,v 1.111 2017/05/05 15:16:25 schwarze Exp $ */
/*
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -71,7 +71,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);
@@ -107,7 +106,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 *);
@@ -126,6 +125,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] = {
@@ -247,7 +247,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 */
};
@@ -1692,22 +1691,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;
}