diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-01-01 13:17:58 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-01-01 13:17:58 +0000 |
commit | 8dfb6885b4ca139f27de89b37393a0570defeee6 (patch) | |
tree | d8db8a4f48ff913d7a54992a0b8432e99c034252 /mdoc_term.c | |
parent | 41eb251d81c9a1ef2f4036c8b217c0f024b490c2 (diff) | |
download | mandoc-8dfb6885b4ca139f27de89b37393a0570defeee6.tar.gz mandoc-8dfb6885b4ca139f27de89b37393a0570defeee6.tar.zst mandoc-8dfb6885b4ca139f27de89b37393a0570defeee6.zip |
`Fl' has each argument be in a separate scope (thanks Ingo Schwarze).
Situation of `Fl [arg]* "" [arg]*' is fixed: empty arguments are ignored. Note that OpenBSD crashes when this happens.
Situation of `Fl' is fixed wrt trailing whitespace.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index eaafcb14..f465a559 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.102 2009/11/12 05:50:12 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.103 2010/01/01 13:17:59 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -1019,8 +1019,23 @@ termp_fl_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_BOLD); + + /* A zero-length child shouldn't get a dash. */ + + if (n->child) { + assert(MDOC_TEXT == n->child->type); + assert(n->child->string); + if ('\0' == *n->child->string) + return(0); + } + term_word(p, "\\-"); - p->flags |= TERMP_NOSPACE; + + /* A blank `Fl' should incur a subsequent space. */ + + if (n->child) + p->flags |= TERMP_NOSPACE; + return(1); } |