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 | 47413dce678dda2ae975720bf472a4a00ecde62a (patch) | |
tree | 942ea6e02b6e8833cd85829bf173d661f83b7865 /mdoc_term.c | |
parent | c5b2462b76dc92a73a1f5ae0226aea1b37d83f0e (diff) | |
download | mandoc-47413dce678dda2ae975720bf472a4a00ecde62a.tar.gz |
`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 | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index de73b311..82d32adc 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -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); } |