Use the new rc_stringlist_find function.

This commit is contained in:
Roy Marples 2008-09-18 15:28:20 +00:00
parent 17bf78a539
commit 39ea0cb84d
2 changed files with 3 additions and 10 deletions

View File

@ -124,7 +124,6 @@ void env_filter(void)
RC_STRINGLIST *profile = NULL; RC_STRINGLIST *profile = NULL;
RC_STRINGLIST *env_list; RC_STRINGLIST *env_list;
RC_STRING *env; RC_STRING *env;
RC_STRING *s;
char *env_name; char *env_name;
char *e; char *e;
char *token; char *token;
@ -162,10 +161,7 @@ void env_filter(void)
continue; continue;
/* Check our user defined list */ /* Check our user defined list */
TAILQ_FOREACH(s, env_allow, entries) if (rc_stringlist_find(env_allow, env->value))
if (strcmp(s->value, env->value) == 0)
break;
if (s)
continue; continue;
/* Now check our profile */ /* Now check our profile */

View File

@ -128,7 +128,7 @@ static void print_service(const char *service)
static void print_services(const char *runlevel, RC_STRINGLIST *services) static void print_services(const char *runlevel, RC_STRINGLIST *services)
{ {
RC_STRINGLIST *l = NULL; RC_STRINGLIST *l = NULL;
RC_STRING *s, *t; RC_STRING *s;
char *r = NULL; char *r = NULL;
if (! services) if (! services)
@ -156,10 +156,7 @@ static void print_services(const char *runlevel, RC_STRINGLIST *services)
if (!l) if (!l)
return; return;
TAILQ_FOREACH(s, l, entries) { TAILQ_FOREACH(s, l, entries) {
TAILQ_FOREACH(t, services, entries) if (!rc_stringlist_find(services, s->value))
if (strcmp(t->value, s->value) == 0)
break;
if (!t)
continue; continue;
if (!runlevel || rc_service_in_runlevel(s->value, runlevel)) if (!runlevel || rc_service_in_runlevel(s->value, runlevel))
print_service(s->value); print_service(s->value);