diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-24 19:11:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-24 19:11:45 +0000 |
commit | 8d226e7d9f28fbbca5bd6969e8fe3e6ee69ec94e (patch) | |
tree | e007bba721cb9d9e5ad54d2316dd8d2fd6ff6fdd /tree.c | |
parent | 843cccd2fcf4de8a13a16071c949374ee597d16e (diff) | |
download | mandoc-8d226e7d9f28fbbca5bd6969e8fe3e6ee69ec94e.tar.gz |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,6 +1,7 @@ /* $Id$ */ /* * 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) |