=================================================================== RCS file: /cvs/docbook2mdoc/parse.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -p -r1.30 -r1.31 --- docbook2mdoc/parse.c 2019/04/10 14:22:37 1.30 +++ docbook2mdoc/parse.c 2019/04/10 14:34:08 1.31 @@ -1,4 +1,4 @@ -/* $Id: parse.c,v 1.30 2019/04/10 14:22:37 schwarze Exp $ */ +/* $Id: parse.c,v 1.31 2019/04/10 14:34:08 schwarze Exp $ */ /* * Copyright (c) 2014 Kristaps Dzonsons * Copyright (c) 2019 Ingo Schwarze @@ -632,7 +632,7 @@ xml_attrval(struct parse *p, const char *name) * If we're at a text node, roll that one up first. */ static void -xml_elem_end(struct parse *ps, const char *name) +xml_elem_end(struct parse *p, const char *name) { const struct element *elem; struct pnode *n; @@ -643,13 +643,13 @@ xml_elem_end(struct parse *ps, const char *name) * An ancestor is excluded from the tree; * keep track of the number of levels excluded. */ - if (ps->del > 1) { - ps->del--; + if (p->del > 1) { + p->del--; return; } - if (ps->del == 0) - pnode_closetext(ps); + if (p->del == 0) + pnode_closetext(p); if (name != NULL) { for (elem = elements; elem->name != NULL; elem++) @@ -657,34 +657,34 @@ xml_elem_end(struct parse *ps, const char *name) break; node = elem->node; } else - node = ps->ncur; + node = p->ncur; switch (node) { case NODE_DELETE_WARN: case NODE_DELETE: - if (ps->del > 0) - ps->del--; + if (p->del > 0) + p->del--; break; case NODE_IGNORE: break; case NODE_INCLUDE: - n = ps->cur; - ps->cur = ps->cur->parent; + n = p->cur; + p->cur = p->cur->parent; cp = pnode_getattr_raw(n, ATTRKEY_HREF, NULL); if (cp == NULL) - error_msg(ps, " element " + error_msg(p, " element " "without href attribute"); else - parse_file(ps, -1, cp); + parse_file(p, -1, cp); pnode_unlink(n); - ps->flags &= ~PFLAG_SPC; + p->flags &= ~PFLAG_SPC; break; case NODE_DOCTYPE: - ps->flags &= ~PFLAG_EEND; + p->flags &= ~PFLAG_EEND; /* FALLTHROUGH */ default: - if (ps->cur == NULL || node != ps->cur->node) { - warn_msg(ps, "element not open: ", name); + if (p->cur == NULL || node != p->cur->node) { + warn_msg(p, "element not open: ", name); break; } @@ -695,16 +695,16 @@ xml_elem_end(struct parse *ps, const char *name) * obviously better than discarding it or crashing. */ - if (ps->cur->parent != NULL || node == NODE_DOCTYPE) { - ps->cur = ps->cur->parent; - if (ps->cur != NULL) - ps->ncur = ps->cur->node; + if (p->cur->parent != NULL || node == NODE_DOCTYPE) { + p->cur = p->cur->parent; + if (p->cur != NULL) + p->ncur = p->cur->node; } else - ps->tree->flags |= TREE_CLOSED; - ps->flags &= ~PFLAG_SPC; + p->tree->flags |= TREE_CLOSED; + p->flags &= ~PFLAG_SPC; break; } - assert(ps->del == 0); + assert(p->del == 0); } struct parse *