aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 69976a38..cf583647 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.12 2011/11/26 11:23:56 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.13 2011/11/26 22:38:11 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -378,7 +378,7 @@ main(int argc, char *argv[])
&maxrec, &recs, &recsz);
if (OP_UPDATE == op)
- index_merge(of, mp, &dbuf, &buf, hash,
+ index_merge(of, mp, &dbuf, &buf, hash,
db, fbuf, idx, ibuf, use_all,
verb, maxrec, recs, reccur);
@@ -411,11 +411,16 @@ main(int argc, char *argv[])
sz2 = strlcat(ibuf, MANDOC_IDX, MAXPATHLEN);
if (sz1 >= MAXPATHLEN || sz2 >= MAXPATHLEN) {
- fprintf(stderr, "%s: Path too long\n",
+ fprintf(stderr, "%s: Path too long\n",
dirs.paths[i]);
exit((int)MANDOCLEVEL_BADARG);
}
+ if (db)
+ (*db->close)(db);
+ if (idx)
+ (*idx->close)(idx);
+
db = dbopen(fbuf, flags, 0644, DB_BTREE, &info);
idx = dbopen(ibuf, flags, 0644, DB_RECNO, NULL);
@@ -444,7 +449,7 @@ main(int argc, char *argv[])
of = of->first;
- index_merge(of, mp, &dbuf, &buf, hash, db, fbuf,
+ index_merge(of, mp, &dbuf, &buf, hash, db, fbuf,
idx, ibuf, use_all, verb,
maxrec, recs, reccur);
}
@@ -471,7 +476,7 @@ out:
void
index_merge(const struct of *of, struct mparse *mp,
struct buf *dbuf, struct buf *buf,
- DB *hash, DB *db, const char *dbf,
+ DB *hash, DB *db, const char *dbf,
DB *idx, const char *idxf, int use_all, int verb,
recno_t maxrec, const recno_t *recs, size_t reccur)
{