diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-22 16:07:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-22 16:07:16 +0000 |
commit | 1c6894f509f4d5465a9c42324e61b4af5dabb3b9 (patch) | |
tree | a2bda16459077490c4c7a91a74c63bc67152f156 | |
parent | a47c2723999e135348912a7c9c9b2060866c3a44 (diff) | |
download | mandoc-1c6894f509f4d5465a9c42324e61b4af5dabb3b9.tar.gz |
When running into a mandoc.db(5) file still using the obsolete
format based on SQLite 3, say so in words that mortals can
understand rather than babbling about hex magic.
Suggested by espie@.
-rw-r--r-- | dbm_map.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -80,8 +80,14 @@ dbm_map(const char *fname) goto fail; magic = dbm_getint(0); if (be32toh(*magic) != MANDOCDB_MAGIC) { - warnx("dbm_map(%s): Bad initial magic %x (expected %x)", - fname, be32toh(*magic), MANDOCDB_MAGIC); + if (strncmp(dbm_base, "SQLite format 3", 15)) + warnx("dbm_map(%s): " + "Bad initial magic %x (expected %x)", + fname, be32toh(*magic), MANDOCDB_MAGIC); + else + warnx("dbm_map(%s): " + "Obsolete format based on SQLite 3", + fname); errno = EFTYPE; goto fail; } |