aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-04 16:27:03 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-04 16:27:03 +0000
commit8cd14fd71e9c955ff37349652f455dca31e49c36 (patch)
treedadb0ad4f49445cd6655d1ccddd6c4297b6e120a /mdoc_term.c
parent988f06d4304a171332f90881f14c10b54dad514a (diff)
downloadmandoc-8cd14fd71e9c955ff37349652f455dca31e49c36.tar.gz
mandoc-8cd14fd71e9c955ff37349652f455dca31e49c36.tar.zst
mandoc-8cd14fd71e9c955ff37349652f455dca31e49c36.zip
Last low-hanging removal of superfluous variable assignments.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index bdbbd8b4..47c21248 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.225 2011/04/04 16:21:51 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.226 2011/04/04 16:27:03 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -1536,24 +1536,31 @@ termp_ft_pre(DECL_ARGS)
static int
termp_fn_pre(DECL_ARGS)
{
- const struct mdoc_node *nn;
+ int pretty;
+
+ pretty = MDOC_SYNPRETTY & n->flags;
synopsis_pre(p, n);
+ if (NULL == (n = n->child))
+ return(0);
+
+ assert(MDOC_TEXT == n->type);
term_fontpush(p, TERMFONT_BOLD);
- term_word(p, n->child->string);
+ term_word(p, n->string);
term_fontpop(p);
p->flags |= TERMP_NOSPACE;
term_word(p, "(");
p->flags |= TERMP_NOSPACE;
- for (nn = n->child->next; nn; nn = nn->next) {
+ for (n = n->next; n; n = n->next) {
+ assert(MDOC_TEXT == n->type);
term_fontpush(p, TERMFONT_UNDER);
- term_word(p, nn->string);
+ term_word(p, n->string);
term_fontpop(p);
- if (nn->next) {
+ if (n->next) {
p->flags |= TERMP_NOSPACE;
term_word(p, ",");
}
@@ -1562,7 +1569,7 @@ termp_fn_pre(DECL_ARGS)
p->flags |= TERMP_NOSPACE;
term_word(p, ")");
- if (MDOC_SYNPRETTY & n->flags) {
+ if (pretty) {
p->flags |= TERMP_NOSPACE;
term_word(p, ";");
}