summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-18 08:55:17 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-18 08:55:17 +0000
commit172a6f5a12e7614d3c52f6331657926b06a384cc (patch)
treee0236a24e79854e9a41c8eeed239b02fa6c1009c
parentdaa8595cb1e356ec71ad2b427e35275d0c2ed784 (diff)
downloadmandoc-172a6f5a12e7614d3c52f6331657926b06a384cc.tar.gz
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
-rw-r--r--mandocdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 4400f2aa..641219c7 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1302,6 +1302,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) {