diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2011-11-26 22:38:11 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2011-11-26 22:38:11 +0000 |
commit | edb836f226a3e9d500cba400695648b0a3ee6585 (patch) | |
tree | 9bac1273d1f20dec6c26f4b7dc1eec6b498342c7 /mandocdb.c | |
parent | 0aba7e883febd4a1eb4d3f54a32041eccd254290 (diff) | |
download | mandoc-edb836f226a3e9d500cba400695648b0a3ee6585.tar.gz |
Sync to OpenBSD, mostly gratuitous and whitespace differences,
but a few serious things as well:
* -M overrides MANPATH
* -m prepends to the path
* put back database close calls that got lost in mandocdb
* missing sys/types.h in manpath.c, needed for size_t
ok kristaps@
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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) { |