From 1c6894f509f4d5465a9c42324e61b4af5dabb3b9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 22 Aug 2016 16:07:16 +0000 Subject: 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@. --- dbm_map.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dbm_map.c b/dbm_map.c index b4d5bb80..2d1315f6 100644 --- a/dbm_map.c +++ b/dbm_map.c @@ -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; } -- cgit