summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-01-16 02:56:48 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-01-16 02:56:48 +0000
commit95a98d61bcc1aaaa5e6e3155c99af5cdb4a72608 (patch)
treec8a89e763ac463c3c47b1123506560d692105a37 /usr.bin/mandoc/man_term.c
parent57acadac999e4338490c1732cad3c069449eca78 (diff)
If the first character of a free-form text input line is whitespace,
then it will start a new output line; from kristaps@.
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 0cdf4ca08c4..1f93e57d939 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.59 2011/01/11 00:59:28 schwarze Exp $ */
+/* $Id: man_term.c,v 1.60 2011/01/16 02:56:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -855,10 +855,13 @@ print_man_node(DECL_ARGS)
switch (n->type) {
case(MAN_TEXT):
- if (0 == *n->string) {
+ if ('\0' == *n->string) {
term_vspace(p);
break;
- }
+ }
+
+ if (' ' == *n->string && MAN_LINE & n->flags)
+ term_newln(p);
term_word(p, n->string);
@@ -874,6 +877,7 @@ print_man_node(DECL_ARGS)
p->rmargin = rm;
p->maxrmargin = rmax;
}
+
break;
case (MAN_TBL):
if (TBL_SPAN_FIRST & n->span->flags)