summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/tree.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2013-12-24 19:10:35 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2013-12-24 19:10:35 +0000
commit3043e4d18d3f19a38b74cbce28987b0e5218d43a (patch)
treeb1f31bc1e515eb02c3fed99281265babdc0d543b /usr.bin/mandoc/tree.c
parentcd429ee8cd9d937595d233fa7eb6aa5c6828878d (diff)
When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins) to the line where the second one starts. This fixes the bug that .Bk allowed output line breaks right after block macros spanning more than one input line, even when the next macro follows on the same line.
Diffstat (limited to 'usr.bin/mandoc/tree.c')
-rw-r--r--usr.bin/mandoc/tree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/mandoc/tree.c b/usr.bin/mandoc/tree.c
index dad34f56702..ef4eed4ecd6 100644
--- a/usr.bin/mandoc/tree.c
+++ b/usr.bin/mandoc/tree.c
@@ -1,6 +1,7 @@
-/* $Id: tree.c,v 1.18 2013/09/15 17:33:47 schwarze Exp $ */
+/* $Id: tree.c,v 1.19 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 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
@@ -159,7 +160,10 @@ print_mdoc(const struct mdoc_node *n, int indent)
putchar(' ');
if (MDOC_LINE & n->flags)
putchar('*');
- printf("%d:%d\n", n->line, n->pos);
+ printf("%d:%d", n->line, n->pos);
+ if (n->lastline != n->line)
+ printf("-%d", n->lastline);
+ putchar('\n');
}
if (n->child)