aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-12-15 23:39:40 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-12-15 23:39:40 +0000
commit7aa6a9a39d16b4098093e9ce72a8b4c914a174a7 (patch)
tree617814a1e61bb939e9ae01e0d093e4f481d2d95f /mdoc_macro.c
parent017442d6e6ebefe712db5f1122c259fdd7c3e7c5 (diff)
downloadmandoc-7aa6a9a39d16b4098093e9ce72a8b4c914a174a7.tar.gz
mandoc-7aa6a9a39d16b4098093e9ce72a8b4c914a174a7.tar.zst
mandoc-7aa6a9a39d16b4098093e9ce72a8b4c914a174a7.zip
Add a "last child" member of struct mdoc_node.
Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body. Make "skipping paragraph" be an error, not a warning, as information (an invoked macro) is ignored.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 790437cc..1c97f88c 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.98 2010/12/06 11:01:19 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.99 2010/12/15 23:39:40 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -252,6 +252,7 @@ lookup_raw(const char *p)
static int
rew_last(struct mdoc *mdoc, const struct mdoc_node *to)
{
+ struct mdoc_node *n;
assert(to);
mdoc->next = MDOC_NEXT_SIBLING;
@@ -260,8 +261,10 @@ rew_last(struct mdoc *mdoc, const struct mdoc_node *to)
while (mdoc->last != to) {
if ( ! mdoc_valid_post(mdoc))
return(0);
+ n = mdoc->last;
mdoc->last = mdoc->last->parent;
assert(mdoc->last);
+ mdoc->last->last = n;
}
return(mdoc_valid_post(mdoc));