aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-09 14:10:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-09 14:10:01 +0000
commit39734eb01d30f4fff1da35538dbe086698bf9d43 (patch)
tree47c9e25683b72c07539a59eb76cf93604b8e9578 /mdoc_term.c
parentb07175c583be6f4b4733c49a5e4e855490ea5191 (diff)
downloadmandoc-39734eb01d30f4fff1da35538dbe086698bf9d43.tar.gz
mandoc-39734eb01d30f4fff1da35538dbe086698bf9d43.tar.zst
mandoc-39734eb01d30f4fff1da35538dbe086698bf9d43.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 'mdoc_term.c')
-rw-r--r--mdoc_term.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 08620365..e4c0b92c 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.356 2017/05/07 17:31:45 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.357 2017/05/09 14:10:01 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -342,7 +342,8 @@ print_mdoc_node(DECL_ARGS)
switch (n->type) {
case ROFFT_TEXT:
- if (' ' == *n->string && NODE_LINE & n->flags)
+ if (*n->string == ' ' && n->flags & NODE_LINE &&
+ (p->flags & TERMP_NONEWLINE) == 0)
term_newln(p);
if (NODE_DELIMC & n->flags)
p->flags |= TERMP_NOSPACE;