From bf9cd278f0762f5462721f4edb03b4172663d23f Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 12 Jan 2011 10:43:22 +0000 Subject: If the first character of free-form text is whitespace, then a newline shall precede outputted text (surprise!). --- man_term.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'man_term.c') 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 * Copyright (c) 2010, 2011 Ingo Schwarze @@ -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) -- cgit v1.2.3-56-ge451