From 15a545d1196bd2454c341893c1f5150bfff17fd2 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 26 Sep 2015 00:32:35 +0000 Subject: resolve code duplication and do style cleanup in mdoc_nm_pre(), no functional change --- mdoc_html.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mdoc_html.c b/mdoc_html.c index 878bbce6..a4272dcf 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -641,17 +641,13 @@ mdoc_nm_pre(MDOC_ARGS) int len; switch (n->type) { - case ROFFT_ELEM: - PAIR_CLASS_INIT(&tag, "name"); - print_otag(h, TAG_B, 1, &tag); - if (NULL == n->child && meta->name) - print_text(h, meta->name); - return(1); case ROFFT_HEAD: print_otag(h, TAG_TD, 0, NULL); + /* FALLTHROUGH */ + case ROFFT_ELEM: PAIR_CLASS_INIT(&tag, "name"); print_otag(h, TAG_B, 1, &tag); - if (NULL == n->child && meta->name) + if (n->child == NULL && meta->name != NULL) print_text(h, meta->name); return(1); case ROFFT_BODY: @@ -669,7 +665,7 @@ mdoc_nm_pre(MDOC_ARGS) if (n->type == ROFFT_TEXT) len += html_strlen(n->string); - if (0 == len && meta->name) + if (len == 0 && meta->name != NULL) len = html_strlen(meta->name); SCALE_HS_INIT(&su, len); -- cgit