=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.134 retrieving revision 1.136 diff -u -p -r1.134 -r1.136 --- mandoc/man_html.c 2017/03/15 11:29:53 1.134 +++ mandoc/man_html.c 2017/04/24 23:06:18 1.136 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.134 2017/03/15 11:29:53 schwarze Exp $ */ +/* $Id: man_html.c,v 1.136 2017/04/24 23:06:18 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -71,8 +71,7 @@ static int man_in_pre(MAN_ARGS); static void man_root_post(MAN_ARGS); static void man_root_pre(MAN_ARGS); -static const struct htmlman mans[MAN_MAX] = { - { man_br_pre, NULL }, /* br */ +static const struct htmlman __mans[MAN_MAX - MAN_TH] = { { NULL, NULL }, /* TH */ { man_SH_pre, NULL }, /* SH */ { man_SS_pre, NULL }, /* SS */ @@ -93,6 +92,7 @@ static const struct htmlman mans[MAN_MAX] = { { man_I_pre, NULL }, /* I */ { man_alt_pre, NULL }, /* IR */ { man_alt_pre, NULL }, /* RI */ + { man_br_pre, NULL }, /* br */ { man_br_pre, NULL }, /* sp */ { NULL, NULL }, /* nf */ { NULL, NULL }, /* fi */ @@ -111,6 +111,7 @@ static const struct htmlman mans[MAN_MAX] = { { NULL, NULL }, /* UE */ { man_ign_pre, NULL }, /* ll */ }; +static const struct htmlman *const mans = __mans - MAN_TH; /* @@ -440,7 +441,8 @@ man_SH_pre(MAN_ARGS) if (n->type == ROFFT_HEAD) { id = html_make_id(n); print_otag(h, TAG_H1, "cTi", "Sh", id); - print_otag(h, TAG_A, "chR", "selflink", id); + if (id != NULL) + print_otag(h, TAG_A, "chR", "selflink", id); free(id); } return 1; @@ -509,7 +511,8 @@ man_SS_pre(MAN_ARGS) if (n->type == ROFFT_HEAD) { id = html_make_id(n); print_otag(h, TAG_H2, "cTi", "Ss", id); - print_otag(h, TAG_A, "chR", "selflink", id); + if (id != NULL) + print_otag(h, TAG_A, "chR", "selflink", id); free(id); } return 1;