summaryrefslogtreecommitdiffstats
path: root/mandoc-db.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-03 10:08:09 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-03 10:08:09 +0000
commit928c38849630f8de177f6784d1c75e6953029385 (patch)
tree6d17132c07ffca495cb7f022394d450dc97f7af7 /mandoc-db.c
parent06b3add3ba2e81181f5cb743d4f7d866b0747321 (diff)
downloadmandoc-928c38849630f8de177f6784d1c75e6953029385.tar.gz
Have mandoc-db grok `Dt'/`TH' manual title as well.
Diffstat (limited to 'mandoc-db.c')
-rw-r--r--mandoc-db.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mandoc-db.c b/mandoc-db.c
index db8b5790..bba35a4d 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -223,6 +223,7 @@ main(int argc, char *argv[])
struct man *man; /* resulting man */
char *fn; /* current file being parsed */
const char *msec, /* manual section */
+ *mtitle, /* manual title */
*dir; /* result dir (default: cwd) */
char ibuf[MAXPATHLEN], /* index fname */
ibbuf[MAXPATHLEN], /* index backup fname */
@@ -356,8 +357,12 @@ main(int argc, char *argv[])
msec = NULL != mdoc ?
mdoc_meta(mdoc)->msec :
man_meta(man)->msec;
+ mtitle = NULL != mdoc ?
+ mdoc_meta(mdoc)->title :
+ man_meta(man)->title;
assert(msec);
+ assert(mtitle);
/*
* The index record value consists of a nil-terminated
@@ -370,6 +375,7 @@ main(int argc, char *argv[])
dbt_init(&rval, &rsz);
dbt_appendb(&rval, &rsz, fn, strlen(fn) + 1);
dbt_appendb(&rval, &rsz, msec, strlen(msec) + 1);
+ dbt_appendb(&rval, &rsz, mtitle, strlen(mtitle) + 1);
sv = rval.size;
/* Fix the record number in the btree value. */