diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-08-22 16:05:57 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-08-22 16:05:57 +0000 |
commit | a505e70d55955aea7fb923bd5ab6616b5d99133b (patch) | |
tree | 0b6406a0a8825450c160d88b97982a4f50a0991b /usr.bin/mandoc/dbm_map.c | |
parent | 99f613ca416410fc386aad012bc730b46cbd9c58 (diff) |
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 'usr.bin/mandoc/dbm_map.c')
-rw-r--r-- | usr.bin/mandoc/dbm_map.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/mandoc/dbm_map.c b/usr.bin/mandoc/dbm_map.c index 4c81197a91a..ce1e0660b76 100644 --- a/usr.bin/mandoc/dbm_map.c +++ b/usr.bin/mandoc/dbm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dbm_map.c,v 1.1 2016/08/01 10:32:39 schwarze Exp $ */ +/* $OpenBSD: dbm_map.c,v 1.2 2016/08/22 16:05:56 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * @@ -70,8 +70,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; } |