Module Name: src
Committed By: apb
Date: Thu Apr 2 21:39:33 UTC 2009
Modified Files:
src/libexec/makewhatis: makewhatis.c
Log Message:
In addwhatis(), two items should not be treated as duplicates unless
both the "data" and "prefix" elements are identical. For example, the
two lines
amiga/boot (8) - system bootstrapping procedures
amd64/boot (8) - system bootstrapping procedures
both appear with data = "boot (8) - system bootstrapping procedures" but
with different values for prefix, and we do not want to reject one of
them as a duplicate.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/libexec/makewhatis/makewhatis.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/makewhatis/makewhatis.c
diff -u src/libexec/makewhatis/makewhatis.c:1.46 src/libexec/makewhatis/makewhatis.c:1.47
--- src/libexec/makewhatis/makewhatis.c:1.46 Sun Nov 16 06:26:12 2008
+++ src/libexec/makewhatis/makewhatis.c Thu Apr 2 21:39:33 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: makewhatis.c,v 1.46 2008/11/16 06:26:12 dholland Exp $ */
+/* $NetBSD: makewhatis.c,v 1.47 2009/04/02 21:39:33 apb Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
#if !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1999\
The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: makewhatis.c,v 1.46 2008/11/16 06:26:12 dholland Exp $");
+__RCSID("$NetBSD: makewhatis.c,v 1.47 2009/04/02 21:39:33 apb Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -540,6 +540,7 @@
while ((wi = *tree) != NULL) {
result = strcmp(data, wi->wi_data);
+ if (result == 0) result = strcmp(prefix, wi->wi_prefix);
if (result == 0) return;
tree = result < 0 ? &wi->wi_left : &wi->wi_right;
}