=================================================================== RCS file: /cvs/mandoc/mdoc.c,v retrieving revision 1.200 retrieving revision 1.202 diff -u -p -r1.200 -r1.202 --- mandoc/mdoc.c 2012/07/18 10:39:19 1.200 +++ mandoc/mdoc.c 2012/11/16 13:40:36 1.202 @@ -1,7 +1,7 @@ -/* $Id: mdoc.c,v 1.200 2012/07/18 10:39:19 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.202 2012/11/16 13:40:36 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010 Ingo Schwarze + * Copyright (c) 2010, 2012 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -375,6 +375,8 @@ node_append(struct mdoc *mdoc, struct mdoc_node *p) switch (p->type) { case (MDOC_BODY): + if (ENDBODY_NOT != p->end) + break; /* FALLTHROUGH */ case (MDOC_TAIL): /* FALLTHROUGH */ @@ -501,6 +503,7 @@ mdoc_endbody_alloc(struct mdoc *m, int line, int pos, p = node_alloc(m, line, pos, tok, MDOC_BODY); p->pending = body; + p->norm = body->norm; p->end = end; if ( ! node_append(m, p)) return(0); @@ -646,6 +649,14 @@ mdoc_node_delete(struct mdoc *m, struct mdoc_node *p) mdoc_node_unlink(m, p); mdoc_node_free(p); +} + +int +mdoc_node_relink(struct mdoc *m, struct mdoc_node *p) +{ + + mdoc_node_unlink(m, p); + return(node_append(m, p)); } #if 0