diff options
author | 2017-05-09 14:09:37 +0000 | |
---|---|---|
committer | 2017-05-09 14:09:37 +0000 | |
commit | 74591f1e552ab9149968418ffe096c81a891092b (patch) | |
tree | 488dcfd716c794dedbfd42480b10db843417b453 /usr.bin/mandoc/man_term.c | |
parent | Prevent memory leak on sbuf by freeing it unconditionally and ensure (diff) | |
download | wireguard-openbsd-74591f1e552ab9149968418ffe096c81a891092b.tar.xz wireguard-openbsd-74591f1e552ab9149968418ffe096c81a891092b.zip |
Trailing \c suppresses the output line break even if
the next line is a text line starting with whitespace.
Quirk found in the sysutils/rancid port.
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r-- | usr.bin/mandoc/man_term.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index dccd8e15c5c..fe21148ea0e 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_term.c,v 1.152 2017/05/07 21:44:33 schwarze Exp $ */ +/* $OpenBSD: man_term.c,v 1.153 2017/05/09 14:09:37 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -871,10 +871,11 @@ print_man_node(DECL_ARGS) * If we have a space as the first character, break * before printing the line's data. */ - if ('\0' == *n->string) { + if (*n->string == '\0') { term_vspace(p); return; - } else if (' ' == *n->string && NODE_LINE & n->flags) + } else if (*n->string == ' ' && n->flags & NODE_LINE && + (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); term_word(p, n->string); |