diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-08-04 18:52:56 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-08-04 18:52:56 +0000 |
commit | 5267a0fcb609fb100fd9824729487784b68574c3 (patch) | |
tree | 5ef09034fafd2d536bee96d0aa38fdf4f7fbf04e | |
parent | cd5361146557ad66e814268730a2cc02743e34b3 (diff) |
In .Bd -literal, break the output line after the last element of each
input line, not after the first element. Since free-form text lines
only have a single element in literal mode, this is only relevant for
macro lines inside literal displays, and only for those containing
more than one macro. Fixes e.g. awk(1) and boot_config(8).
Note this fix differs from what kristaps@ committed to bsd.lv because
those changes introduce regressions with respect to blank lines in
literal mode.
With permission from deraadt@ to still fix bugs in mandoc.
-rw-r--r-- | usr.bin/mandoc/mdoc_term.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c index b7a7b23977f..951fc4ebe00 100644 --- a/usr.bin/mandoc/mdoc_term.c +++ b/usr.bin/mandoc/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.99 2010/07/31 21:43:07 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.100 2010/08/04 18:52:55 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -1649,12 +1649,11 @@ termp_bd_pre(DECL_ARGS) p->rmargin = p->maxrmargin = TERM_MAXMARGIN; for (nn = n->child; nn; nn = nn->next) { - p->flags |= TERMP_NOSPACE; print_mdoc_node(p, pair, m, nn); - if (NULL == nn->prev || - nn->prev->line < nn->line || - NULL == nn->next) - term_flushln(p); + if (nn->next && nn->next->line == nn->line) + continue; + term_flushln(p); + p->flags |= TERMP_NOSPACE; } p->tabwidth = tabwidth; |