aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dbm_map.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-08-22 16:07:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-08-22 16:07:16 +0000
commit9430ba5b3692e61b8f841adb1754b2c327c2fd85 (patch)
treeee7a3d6190b87a85f2c26a9b2400b06e096dbe69 /dbm_map.c
parent14a182308c2f35adb760c79556d4e46091008341 (diff)
downloadmandoc-9430ba5b3692e61b8f841adb1754b2c327c2fd85.tar.gz
mandoc-9430ba5b3692e61b8f841adb1754b2c327c2fd85.tar.zst
mandoc-9430ba5b3692e61b8f841adb1754b2c327c2fd85.zip
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@.
Diffstat (limited to 'dbm_map.c')
-rw-r--r--dbm_map.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/dbm_map.c b/dbm_map.c
index 4ac5fa39..ddcb032c 100644
--- a/dbm_map.c
+++ b/dbm_map.c
@@ -1,4 +1,4 @@
-/* $Id: dbm_map.c,v 1.3 2016/08/05 23:15:08 schwarze Exp $ */
+/* $Id: dbm_map.c,v 1.4 2016/08/22 16:07:16 schwarze Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -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;
}