=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_man.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- src/usr.bin/mandoc/mdoc_man.c 2014/01/22 20:58:35 1.57 +++ src/usr.bin/mandoc/mdoc_man.c 2014/01/24 11:56:34 1.58 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.57 2014/01/22 20:58:35 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.58 2014/01/24 11:56:34 schwarze Exp $ */ /* * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze * @@ -594,7 +594,7 @@ */ act = manacts + n->tok; cond = NULL == act->cond || (*act->cond)(meta, n); - if (cond && act->pre) + if (cond && act->pre && ENDBODY_NOT == n->end) do_sub = (*act->pre)(meta, n); } @@ -610,8 +610,17 @@ /* * Lastly, conditionally run the post-node handler. */ + if (MDOC_ENDED & n->flags) + return; + if (cond && act->post) (*act->post)(meta, n); + + if (ENDBODY_NOT != n->end) + n->pending->flags |= MDOC_ENDED; + + if (ENDBODY_NOSPACE == n->end) + outflags &= ~(MMAN_spc | MMAN_nl); } static int @@ -649,7 +658,7 @@ suffix = manacts[n->tok].suffix; if (NULL == suffix) return; - outflags &= ~MMAN_spc; + outflags &= ~(MMAN_spc | MMAN_nl); print_word(suffix); }