aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-12 10:43:22 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-12 10:43:22 +0000
commitbf9cd278f0762f5462721f4edb03b4172663d23f (patch)
tree039daf4f957a0b2ddd6adf6b1082739bf927cb6c /man_term.c
parent15176c550e36917edca474cf54bf81fdcd5cc066 (diff)
downloadmandoc-bf9cd278f0762f5462721f4edb03b4172663d23f.tar.gz
mandoc-bf9cd278f0762f5462721f4edb03b4172663d23f.tar.zst
mandoc-bf9cd278f0762f5462721f4edb03b4172663d23f.zip
If the first character of free-form text is whitespace, then a newline
shall precede outputted text (surprise!).
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/man_term.c b/man_term.c
index 8500ad9f..c94900fc 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.95 2011/01/11 00:39:00 kristaps Exp $ */
+/* $Id: man_term.c,v 1.96 2011/01/12 10:43:22 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -859,10 +859,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);
@@ -878,6 +881,7 @@ print_man_node(DECL_ARGS)
p->rmargin = rm;
p->maxrmargin = rmax;
}
+
break;
case (MAN_TBL):
if (TBL_SPAN_FIRST & n->span->flags)