aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tree.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-24 19:11:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-24 19:11:45 +0000
commitb303922601f56d18c6f93423c4ff3d27382f885e (patch)
treeffc9e8ded8098926789638d9ae1ecb3aec856e4e /tree.c
parent34224dec94613f2de8682103514f13b796cbb181 (diff)
downloadmandoc-b303922601f56d18c6f93423c4ff3d27382f885e.tar.gz
mandoc-b303922601f56d18c6f93423c4ff3d27382f885e.tar.zst
mandoc-b303922601f56d18c6f93423c4ff3d27382f885e.zip
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 'tree.c')
-rw-r--r--tree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tree.c b/tree.c
index 08a76b80..fdb70e1b 100644
--- a/tree.c
+++ b/tree.c
@@ -1,6 +1,7 @@
-/* $Id: tree.c,v 1.49 2013/09/15 17:33:57 schwarze Exp $ */
+/* $Id: tree.c,v 1.50 2013/12/24 19:11:46 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
@@ -163,7 +164,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)