From 39ea0cb84dd2eded881e1c77e758505dd08beb99 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 18 Sep 2008 15:28:20 +0000 Subject: Use the new rc_stringlist_find function. --- src/rc/rc-misc.c | 6 +----- src/rc/rc-status.c | 7 ++----- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c index 22e2e309..bf03a35c 100644 --- a/src/rc/rc-misc.c +++ b/src/rc/rc-misc.c @@ -124,7 +124,6 @@ void env_filter(void) RC_STRINGLIST *profile = NULL; RC_STRINGLIST *env_list; RC_STRING *env; - RC_STRING *s; char *env_name; char *e; char *token; @@ -162,10 +161,7 @@ void env_filter(void) continue; /* Check our user defined list */ - TAILQ_FOREACH(s, env_allow, entries) - if (strcmp(s->value, env->value) == 0) - break; - if (s) + if (rc_stringlist_find(env_allow, env->value)) continue; /* Now check our profile */ diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index 41ac6519..c25a4eec 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -128,7 +128,7 @@ static void print_service(const char *service) static void print_services(const char *runlevel, RC_STRINGLIST *services) { RC_STRINGLIST *l = NULL; - RC_STRING *s, *t; + RC_STRING *s; char *r = NULL; if (! services) @@ -156,10 +156,7 @@ static void print_services(const char *runlevel, RC_STRINGLIST *services) if (!l) return; TAILQ_FOREACH(s, l, entries) { - TAILQ_FOREACH(t, services, entries) - if (strcmp(t->value, s->value) == 0) - break; - if (!t) + if (!rc_stringlist_find(services, s->value)) continue; if (!runlevel || rc_service_in_runlevel(s->value, runlevel)) print_service(s->value); -- cgit v1.2.3