Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin cleanup TAILQ use
details: https://anonhg.NetBSD.org/src/rev/78a8641f39c7
branches: trunk
changeset: 532621:78a8641f39c7
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Jun 11 07:17:15 2002 +0000
description:
cleanup TAILQ use
diffstat:
usr.bin/apropos/apropos.c | 9 ++++-----
usr.bin/whatis/whatis.c | 9 ++++-----
2 files changed, 8 insertions(+), 10 deletions(-)
diffs (60 lines):
diff -r 7e0706246212 -r 78a8641f39c7 usr.bin/apropos/apropos.c
--- a/usr.bin/apropos/apropos.c Tue Jun 11 06:06:18 2002 +0000
+++ b/usr.bin/apropos/apropos.c Tue Jun 11 07:17:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apropos.c,v 1.18 2002/06/11 05:46:50 itojun Exp $ */
+/* $NetBSD: apropos.c,v 1.19 2002/06/11 07:17:15 lukem Exp $ */
/*
* Copyright (c) 1987, 1993, 1994
@@ -44,7 +44,7 @@
#if 0
static char sccsid[] = "@(#)apropos.c 8.8 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: apropos.c,v 1.18 2002/06/11 05:46:50 itojun Exp $");
+__RCSID("$NetBSD: apropos.c,v 1.19 2002/06/11 07:17:15 lukem Exp $");
#endif
#endif /* not lint */
@@ -121,9 +121,8 @@
apropos(argv, p_path, 1);
else {
config(conffile);
- ep = (tp = getlist("_whatdb", 0)) == NULL ?
- NULL : TAILQ_FIRST(&tp->list);
- for (; ep != NULL; ep = TAILQ_NEXT(ep, q)) {
+ tp = getlist("_whatdb", 1);
+ TAILQ_FOREACH(ep, &tp->list, q) {
if ((rv = glob(ep->s, GLOB_BRACE | GLOB_NOSORT, NULL,
&pg)) != 0) {
if (rv == GLOB_NOMATCH)
diff -r 7e0706246212 -r 78a8641f39c7 usr.bin/whatis/whatis.c
--- a/usr.bin/whatis/whatis.c Tue Jun 11 06:06:18 2002 +0000
+++ b/usr.bin/whatis/whatis.c Tue Jun 11 07:17:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: whatis.c,v 1.14 2002/06/11 05:55:24 itojun Exp $ */
+/* $NetBSD: whatis.c,v 1.15 2002/06/11 07:19:01 lukem Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -44,7 +44,7 @@
#if 0
static char sccsid[] = "@(#)whatis.c 8.5 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: whatis.c,v 1.14 2002/06/11 05:55:24 itojun Exp $");
+__RCSID("$NetBSD: whatis.c,v 1.15 2002/06/11 07:19:01 lukem Exp $");
#endif
#endif /* not lint */
@@ -121,9 +121,8 @@
whatis(argv, p_path, 1);
else {
config(conffile);
- ep = (tp = getlist("_whatdb", 0)) == NULL ?
- NULL : TAILQ_FIRST(&tp->list);
- for (; ep != NULL; ep = TAILQ_NEXT(ep, q)) {
+ tp = getlist("_whatdb", 0);
+ TAILQ_FOREACH(ep, &tp->list, q) {
if ((rv = glob(ep->s, GLOB_BRACE | GLOB_NOSORT, NULL,
&pg)) != 0) {
if (rv == GLOB_NOMATCH)
Home |
Main Index |
Thread Index |
Old Index