summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mandocdb.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-01-18 08:54:20 +0000
committerschwarze <schwarze@openbsd.org>2014-01-18 08:54:20 +0000
commita512ec3c8c4b720d8773429f7ca0d9fdadc4d92f (patch)
treebb61caaad86d9a0c7d31efa50e38e8c74259755b /usr.bin/mandoc/mandocdb.c
parentImprove comments re KDF hints. (diff)
downloadwireguard-openbsd-a512ec3c8c4b720d8773429f7ca0d9fdadc4d92f.tar.xz
wireguard-openbsd-a512ec3c8c4b720d8773429f7ca0d9fdadc4d92f.zip
Cope with slightly broken NAME sections in man(7) pages
having a trailing comma after the last name, like this: ASN1_OBJECT_new, ASN1_OBJECT_free, - object allocation functions Nit found somewhere above the Tasman Sea, committing from Dunedin, Otago.
Diffstat (limited to 'usr.bin/mandoc/mandocdb.c')
-rw-r--r--usr.bin/mandoc/mandocdb.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index 2c67696a3ba..e01202d9d38 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.66 2014/01/17 19:16:42 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.67 2014/01/18 08:54:20 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1294,6 +1294,15 @@ parse_man(struct mpage *mpage, const struct man_node *n)
byte = start[sz];
start[sz] = '\0';
+ /*
+ * Assume a stray trailing comma in the
+ * name list if a name begins with a dash.
+ */
+
+ if ('-' == start[0] ||
+ ('\\' == start[0] && '-' == start[1]))
+ break;
+
putkey(mpage, start, TYPE_Nm);
if (' ' == byte) {