aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-12 01:45:55 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-12 01:45:55 +0000
commitafdfffe6880d8a1cb2927ec9899fda98180533a2 (patch)
treeea3669aa8187a488287ebab9b979b0a432babe3d
parent4f6a6ddafb82666c36a50f73c62a3a0ed9e07cc6 (diff)
downloadmandoc-afdfffe6880d8a1cb2927ec9899fda98180533a2.tar.gz
mandoc-afdfffe6880d8a1cb2927ec9899fda98180533a2.tar.zst
mandoc-afdfffe6880d8a1cb2927ec9899fda98180533a2.zip
Make sure that we check for the \(en, \(em, \-, and - separators for
the heuristic dance to grab manual descriptions from man documents.
-rw-r--r--mandoc-db.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mandoc-db.c b/mandoc-db.c
index 74796459..d62fbbd1 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc-db.c,v 1.19 2011/05/04 20:43:38 kristaps Exp $ */
+/* $Id: mandoc-db.c,v 1.20 2011/05/12 01:45:55 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -871,6 +871,7 @@ pman_node(MAN_ARGS)
/*
* Go through a special heuristic dance here.
* This is why -man manuals are great!
+ * (I'm being sarcastic: my eyes are bleeding.)
* Conventionally, one or more manual names are
* comma-specified prior to a whitespace, then a
* dash, then a description. Try to puzzle out
@@ -908,10 +909,14 @@ pman_node(MAN_ARGS)
while (' ' == *start)
start++;
- if ('\\' == *start && '-' == *(start + 1))
+ if (0 == strncmp(start, "-", 1))
+ start += 1;
+ else if (0 == strncmp(start, "\\-", 2))
start += 2;
- else if ('-' == *start)
- start++;
+ else if (0 == strncmp(start, "\\(en", 4))
+ start += 4;
+ else if (0 == strncmp(start, "\\(em", 4))
+ start += 4;
while (' ' == *start)
start++;