diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-09-26 00:32:35 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-09-26 00:32:35 +0000 |
commit | 41adc72e761bdad350233dd0d9a96b77cef27871 (patch) | |
tree | f585b33388347a862c8e7591f023acda48f9b0db | |
parent | 9aae3f150162ed7ad503f4ce199190dddeb01b95 (diff) | |
download | mandoc-41adc72e761bdad350233dd0d9a96b77cef27871.tar.gz mandoc-41adc72e761bdad350233dd0d9a96b77cef27871.tar.zst mandoc-41adc72e761bdad350233dd0d9a96b77cef27871.zip |
resolve code duplication and do style cleanup in mdoc_nm_pre(),
no functional change
-rw-r--r-- | mdoc_html.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index eefb7966..1d34a39d 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.234 2015/09/26 00:22:07 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.235 2015/09/26 00:32:35 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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); |