=================================================================== RCS file: /cvs/mandoc/dbm_map.c,v retrieving revision 1.1 retrieving revision 1.4 diff -u -p -r1.1 -r1.4 --- mandoc/dbm_map.c 2016/07/19 21:31:55 1.1 +++ mandoc/dbm_map.c 2016/08/22 16:07:16 1.4 @@ -1,4 +1,4 @@ -/* $Id: dbm_map.c,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ +/* $Id: dbm_map.c,v 1.4 2016/08/22 16:07:16 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -18,12 +18,22 @@ * of the mandoc database, for read-only access. * The interface is defined in "dbm_map.h". */ +#include "config.h" + #include #include #include +#if HAVE_ENDIAN #include +#elif HAVE_SYS_ENDIAN +#include +#elif HAVE_NTOHL +#include +#endif +#if HAVE_ERR #include +#endif #include #include #include @@ -70,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; }