summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-19 12:53:51 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-19 12:53:51 +0000
commitdb23811960a46147de5a1bf1a9e0f6ecee948f2f (patch)
tree09d7eb66428374d17eda64402293df1127d51794 /usr.bin
parent5b55e390788ad3e139451afb2285f936dd6c6a8c (diff)
Fix a regression in the previous revision:
When there is no link description, reuse the URI. Reported by tj@ and bentley@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/mdoc_html.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 1fb8236c273..ec6d155311f 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.164 2017/05/30 16:31:25 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.165 2017/06/19 12:53:50 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1320,12 +1320,16 @@ mdoc_lk_pre(MDOC_ARGS)
punct = punct->next;
/* Link target and link text. */
+ descr = link->next;
+ if (descr == punct)
+ descr = link; /* no text */
t = print_otag(h, TAG_A, "cTh", "Lk", link->string);
- for (descr = link->next; descr != punct; descr = descr->next) {
+ do {
if (descr->flags & (NODE_DELIMC | NODE_DELIMO))
h->flags |= HTML_NOSPACE;
print_text(h, descr->string);
- }
+ descr = descr->next;
+ } while (descr != punct);
print_tagq(h, t);
/* Trailing punctuation. */