aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-01-05 22:19:12 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-01-05 22:19:12 +0000
commit4264877fedafa50d22cd832deeebb06fe39779c1 (patch)
tree744d0b309d638495a3dec372b5a9338a59176bf1 /man_term.c
parentcd9c1d618ab51852afade9dfca94e0383afa2ba0 (diff)
downloadmandoc-4264877fedafa50d22cd832deeebb06fe39779c1.tar.gz
mandoc-4264877fedafa50d22cd832deeebb06fe39779c1.tar.zst
mandoc-4264877fedafa50d22cd832deeebb06fe39779c1.zip
In literal mode (.nf), each input line must be kept together
on the same output line, even if it is longer than the output width. This commit fixes a bug allowing an overly long last line of an indented block (.RS) to be broken even in literal mode. The bug was found using the sudo_plugin(4) manual provided by millert@. I introduced the bug in rev. 1.84 during the g2k12 Budapest hackathon.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/man_term.c b/man_term.c
index 73f501a6..db5719ce 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,7 +1,7 @@
-/* $Id: man_term.c,v 1.135 2012/11/17 00:26:33 schwarze Exp $ */
+/* $Id: man_term.c,v 1.136 2013/01/05 22:19:12 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -564,7 +564,7 @@ post_HP(DECL_ARGS)
switch (n->type) {
case (MAN_BODY):
- term_flushln(p);
+ term_newln(p);
p->flags &= ~TERMP_NOBREAK;
p->flags &= ~TERMP_TWOSPACE;
p->offset = mt->offset;
@@ -1001,7 +1001,7 @@ out:
* more specific than this.
*/
if (MANT_LITERAL & mt->fl && ! (TERMP_NOBREAK & p->flags) &&
- NULL != n->next && n->next->line > n->line) {
+ (NULL == n->next || n->next->line > n->line)) {
rm = p->rmargin;
rmax = p->maxrmargin;
p->rmargin = p->maxrmargin = TERM_MAXMARGIN;