summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-08 22:49:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-08 22:49:29 +0000
commitd3889fbd0cc14cfbb7c94f16c680150c79fdb31b (patch)
tree145f322d1a6ff678daa1333ed50758d4663900f5 /mdoc_term.c
parent2b91ea9dc3d7cf804c5f6145eb62eeeb99a4ca5b (diff)
downloadmandoc-d3889fbd0cc14cfbb7c94f16c680150c79fdb31b.tar.gz
fix .Lk for -Tascii and implement it for -Tman
OpenBSD rev. 1.22 and 1.142, respectively
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index a0e7cb72..15c772f3 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -2159,25 +2159,24 @@ termp_li_pre(DECL_ARGS)
static int
termp_lk_pre(DECL_ARGS)
{
- const struct mdoc_node *nn, *sv;
+ const struct mdoc_node *link, *descr;
- term_fontpush(p, TERMFONT_UNDER);
-
- nn = sv = n->child;
-
- if (NULL == nn || NULL == nn->next)
- return(1);
-
- for (nn = nn->next; nn; nn = nn->next)
- term_word(p, nn->string);
-
- term_fontpop(p);
+ if (NULL == (link = n->child))
+ return(0);
- p->flags |= TERMP_NOSPACE;
- term_word(p, ":");
+ if (NULL != (descr = link->next)) {
+ term_fontpush(p, TERMFONT_UNDER);
+ while (NULL != descr) {
+ term_word(p, descr->string);
+ descr = descr->next;
+ }
+ p->flags |= TERMP_NOSPACE;
+ term_word(p, ":");
+ term_fontpop(p);
+ }
term_fontpush(p, TERMFONT_BOLD);
- term_word(p, sv->string);
+ term_word(p, link->string);
term_fontpop(p);
return(0);