=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.108 retrieving revision 1.110 diff -u -p -r1.108 -r1.110 --- mandoc/mdoc_man.c 2017/04/17 13:26:47 1.108 +++ mandoc/mdoc_man.c 2017/05/04 17:48:29 1.110 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.108 2017/04/17 13:26:47 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.110 2017/05/04 17:48:29 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze * @@ -20,6 +20,7 @@ #include #include +#include #include #include "mandoc_aux.h" @@ -119,8 +120,7 @@ static void print_width(const struct mdoc_bl *, static void print_count(int *); static void print_node(DECL_ARGS); -static const struct manact manacts[MDOC_MAX + 1] = { - { NULL, pre_ap, NULL, NULL, NULL }, /* Ap */ +static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = { { NULL, NULL, NULL, NULL, NULL }, /* Dd */ { NULL, NULL, NULL, NULL, NULL }, /* Dt */ { NULL, NULL, NULL, NULL, NULL }, /* Os */ @@ -136,6 +136,7 @@ static const struct manact manacts[MDOC_MAX + 1] = { { NULL, pre_it, post_it, NULL, NULL }, /* It */ { NULL, pre_em, post_font, NULL, NULL }, /* Ad */ { NULL, pre_an, NULL, NULL, NULL }, /* An */ + { NULL, pre_ap, NULL, NULL, NULL }, /* Ap */ { NULL, pre_em, post_font, NULL, NULL }, /* Ar */ { NULL, pre_sy, post_font, NULL, NULL }, /* Cd */ { NULL, pre_sy, post_font, NULL, NULL }, /* Cm */ @@ -238,13 +239,12 @@ static const struct manact manacts[MDOC_MAX + 1] = { { cond_body, pre_en, post_en, NULL, NULL }, /* En */ { NULL, NULL, NULL, NULL, NULL }, /* Dx */ { NULL, NULL, post_percent, NULL, NULL }, /* %Q */ - { NULL, pre_br, NULL, NULL, NULL }, /* br */ { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */ { NULL, NULL, post_percent, NULL, NULL }, /* %U */ { NULL, NULL, NULL, NULL, NULL }, /* Ta */ { NULL, pre_ll, post_sp, NULL, NULL }, /* ll */ - { NULL, NULL, NULL, NULL, NULL }, /* ROOT */ }; +static const struct manact *const manacts = __manacts - MDOC_Dd; static int outflags; #define MMAN_spc (1 << 0) /* blank character before next word */ @@ -651,7 +651,16 @@ print_node(DECL_ARGS) outflags &= ~(MMAN_spc | MMAN_spc_force); else if (outflags & MMAN_Sm) outflags |= MMAN_spc; + } else if (n->tok < ROFF_MAX) { + switch (n->tok) { + case ROFF_br: + pre_br(meta, n); + break; + default: + abort(); + } } else { + assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); /* * Conditionally run the pre-node action handler for a * node.