diff options
author | Colin Watson <cjwatson@debian.org> | 2001-06-16 17:32:39 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2001-06-16 17:32:39 +0000 |
commit | 2dea0865ad896b33c2fe1aae7c1a0a48e9ff62dc (patch) | |
tree | 26030d8bf397a84cdbb4f1fe72689e798cf762ef /libdb/db_store.c | |
parent | 1cbc34c2e42debc46783755133f61ba800fc76f8 (diff) |
More whatis fixes. Document reasons why whatis parsing might fail in
mandb(8). Don't strip binaries.
Diffstat (limited to 'libdb/db_store.c')
-rw-r--r-- | libdb/db_store.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libdb/db_store.c b/libdb/db_store.c index 280259ad..ab2666b6 100644 --- a/libdb/db_store.c +++ b/libdb/db_store.c @@ -54,16 +54,22 @@ static void gripe_insert_unused(char *data) gripe_corrupt_data(); } +/* FAVOUR(a,b) is true if id 'a' is preferred to id 'b', i.e. if 'a' is a + * more canonical database entry than 'b'. This usually goes in comparison + * order, but there's a special exception when FAVOUR_STRAYCATS is set. + */ +#ifdef FAVOUR_STRAYCATS +#define FAVOUR(a,b) ((a < b && !(a == WHATIS_MAN && b == STRAY_CAT)) || \ + (a == STRAY_CAT && b == WHATIS_MAN)) +#else /* !FAVOUR_STRAYCATS */ +#define FAVOUR(a,b) (a < b) +#endif /* FAVOUR_STRAYCATS */ + /* The do_we_replace logic */ static int replace_if_necessary(struct mandata *in, struct mandata *info, datum newkey, datum newcont) { -#ifndef FAVOUR_STRAYCATS - if (in->id < info->id) { -#else /* FAVOUR_STRAYCATS */ - if (in->id < info->id || - (in->id == STRAY_CAT && info->id == WHATIS_MAN)) { -#endif /* !FAVOUR_STRAYCATS */ + if (FAVOUR(in->id, info->id)) { if (MYDBM_REPLACE(dbf, newkey, newcont)) gripe_replace_key(newkey.dptr); } else if (in->id == info->id) |