diff options
author | 2017-05-08 15:33:43 +0000 | |
---|---|---|
committer | 2017-05-08 15:33:43 +0000 | |
commit | 11d70615da8995731d12d90b59e0f147f302755b (patch) | |
tree | ce355d0a11e5dcf49c0a0fb8616f35e326c5c6ac /usr.bin/mandoc/mdoc_man.c | |
parent | Fix exponential CPU use with repeated '*' operators by changing '*' (diff) | |
download | wireguard-openbsd-11d70615da8995731d12d90b59e0f147f302755b.tar.xz wireguard-openbsd-11d70615da8995731d12d90b59e0f147f302755b.zip |
Basic implementation of the roff(7) .ti (temporary indent) request.
Needed by about four dozen ports (thanks to naddy@ for the research).
Diffstat (limited to 'usr.bin/mandoc/mdoc_man.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_man.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c index f20d39c82e4..027af713485 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.112 2017/05/07 17:30:58 schwarze Exp $ */ +/* $OpenBSD: mdoc_man.c,v 1.113 2017/05/08 15:33:43 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org> * @@ -99,10 +99,10 @@ static int pre_in(DECL_ARGS); static int pre_it(DECL_ARGS); static int pre_lk(DECL_ARGS); static int pre_li(DECL_ARGS); -static void pre_ll(DECL_ARGS); static int pre_nm(DECL_ARGS); static int pre_no(DECL_ARGS); static int pre_ns(DECL_ARGS); +static void pre_onearg(DECL_ARGS); static int pre_pp(DECL_ARGS); static int pre_rs(DECL_ARGS); static int pre_sm(DECL_ARGS); @@ -125,9 +125,10 @@ static void print_node(DECL_ARGS); static const void_fp roff_manacts[ROFF_MAX] = { pre_br, pre_ft, - pre_ll, + pre_onearg, pre_sp, pre_ta, + pre_onearg, }; static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = { @@ -1563,9 +1564,12 @@ pre_lk(DECL_ARGS) } static void -pre_ll(DECL_ARGS) +pre_onearg(DECL_ARGS) { - print_line(".ll", 0); + outflags |= MMAN_nl; + print_word("."); + outflags &= ~MMAN_spc; + print_word(roff_name[n->tok]); if (n->child != NULL) print_word(n->child->string); outflags |= MMAN_nl; |