=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/tbl_layout.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/usr.bin/mandoc/tbl_layout.c 2011/04/24 16:22:02 1.8 +++ src/usr.bin/mandoc/tbl_layout.c 2011/05/29 21:22:18 1.9 @@ -1,4 +1,4 @@ -/* $Id: tbl_layout.c,v 1.8 2011/04/24 16:22:02 schwarze Exp $ */ +/* $Id: tbl_layout.c,v 1.9 2011/05/29 21:22:18 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * @@ -68,6 +68,23 @@ char buf[5]; int i; + /* Not all types accept modifiers. */ + + switch (cp->pos) { + case (TBL_CELL_DOWN): + /* FALLTHROUGH */ + case (TBL_CELL_HORIZ): + /* FALLTHROUGH */ + case (TBL_CELL_DHORIZ): + /* FALLTHROUGH */ + case (TBL_CELL_VERT): + /* FALLTHROUGH */ + case (TBL_CELL_DVERT): + return(1); + default: + break; + } + mod: /* * XXX: since, at least for now, modifiers are non-conflicting @@ -423,19 +440,19 @@ } static void -head_adjust(const struct tbl_cell *cell, struct tbl_head *head) +head_adjust(const struct tbl_cell *cellp, struct tbl_head *head) { - if (TBL_CELL_VERT != cell->pos && - TBL_CELL_DVERT != cell->pos) { + if (TBL_CELL_VERT != cellp->pos && + TBL_CELL_DVERT != cellp->pos) { head->pos = TBL_HEAD_DATA; return; } - if (TBL_CELL_VERT == cell->pos) + if (TBL_CELL_VERT == cellp->pos) if (TBL_HEAD_DVERT != head->pos) head->pos = TBL_HEAD_VERT; - if (TBL_CELL_DVERT == cell->pos) + if (TBL_CELL_DVERT == cellp->pos) head->pos = TBL_HEAD_DVERT; }