=================================================================== RCS file: /cvs/mandoc/eqn.c,v retrieving revision 1.36 retrieving revision 1.39 diff -u -p -r1.36 -r1.39 --- mandoc/eqn.c 2011/07/23 18:41:18 1.36 +++ mandoc/eqn.c 2014/03/23 11:25:26 1.39 @@ -1,4 +1,4 @@ -/* $Id: eqn.c,v 1.36 2011/07/23 18:41:18 kristaps Exp $ */ +/* $Id: eqn.c,v 1.39 2014/03/23 11:25:26 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -26,6 +26,7 @@ #include #include "mandoc.h" +#include "mandoc_aux.h" #include "libmandoc.h" #include "libroff.h" @@ -205,9 +206,11 @@ static const struct eqnstr eqnposs[EQNPOS__MAX] = { static const struct eqnstr eqnpiles[EQNPILE__MAX] = { { "", 0 }, /* EQNPILE_NONE */ + { "pile", 4 }, /* EQNPILE_PILE */ { "cpile", 5 }, /* EQNPILE_CPILE */ { "rpile", 5 }, /* EQNPILE_RPILE */ { "lpile", 5 }, /* EQNPILE_LPILE */ + { "col", 3 }, /* EQNPILE_COL */ { "ccol", 4 }, /* EQNPILE_CCOL */ { "rcol", 4 }, /* EQNPILE_RCOL */ { "lcol", 4 }, /* EQNPILE_LCOL */ @@ -292,8 +295,7 @@ eqn_read(struct eqn_node **epp, int ln, */ if (0 == strncmp(p, ".EN", 3)) { - er = eqn_end(ep); - *epp = NULL; + er = eqn_end(epp); p += 3; while (' ' == *p || '\t' == *p) p++; @@ -331,7 +333,7 @@ eqn_alloc(const char *name, int pos, int line, struct p = mandoc_calloc(1, sizeof(struct eqn_node)); - if ('\0' != *name) { + if (name && '\0' != *name) { sz = strlen(name); assert(sz); do { @@ -350,10 +352,14 @@ eqn_alloc(const char *name, int pos, int line, struct } enum rofferr -eqn_end(struct eqn_node *ep) +eqn_end(struct eqn_node **epp) { + struct eqn_node *ep; struct eqn_box *root; enum eqn_rest c; + + ep = *epp; + *epp = NULL; ep->eqn.root = mandoc_calloc(1, sizeof(struct eqn_box));