summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-09-26 00:32:35 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-09-26 00:32:35 +0000
commit15a545d1196bd2454c341893c1f5150bfff17fd2 (patch)
tree22d738726c31c4e1b1766cd820de5dfbccb439a3
parentcf4ee529866fc3539febb53c98766723a5306a7f (diff)
downloadmandoc-15a545d1196bd2454c341893c1f5150bfff17fd2.tar.gz
resolve code duplication and do style cleanup in mdoc_nm_pre(),
no functional change
-rw-r--r--mdoc_html.c12
1 files 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);