aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit388dd18582f940023baf73dca5073083d773b908 (patch)
treebae7b9069d37520e3cc05b673905f3c706390202 /mdoc_term.c
parent6b73c29c454551394bd4ec1bd33e11febceaec68 (diff)
downloadmandoc-388dd18582f940023baf73dca5073083d773b908.tar.gz
mandoc-388dd18582f940023baf73dca5073083d773b908.tar.zst
mandoc-388dd18582f940023baf73dca5073083d773b908.zip
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.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 459462af..cff10571 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,7 +1,7 @@
-/* $Id: mdoc_term.c,v 1.239 2012/07/08 16:52:20 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.240 2012/07/08 22:49:29 schwarze Exp $ */
/*
* 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);