From 9430ba5b3692e61b8f841adb1754b2c327c2fd85 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'dbm_map.c') 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 * @@ -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 v1.2.3-56-ge451