From: Alejandro Colomar Date: Sat, 18 Jan 2025 18:30:12 +0000 (+0100) Subject: src/login_nopam.c: list_match(): Remove local variable X-Git-Tag: 4.17.3~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba5bb8742be7779e4fca69781e6f2b2ac8aa78bc;p=thirdparty%2Fshadow.git src/login_nopam.c: list_match(): Remove local variable Signed-off-by: Alejandro Colomar --- diff --git a/src/login_nopam.c b/src/login_nopam.c index 492f6e209..ca04f68bb 100644 --- a/src/login_nopam.c +++ b/src/login_nopam.c @@ -146,8 +146,6 @@ login_access(const char *user, const char *from) static bool list_match(char *list, const char *item, bool (*match_fn)(char *, const char*)) { - static const char sep[] = ", \t"; - char *tok; /* @@ -156,12 +154,12 @@ list_match(char *list, const char *item, bool (*match_fn)(char *, const char*)) * a match, look for an "EXCEPT" list and recurse to determine whether * the match is affected by any exceptions. */ - while (NULL != (tok = strsep(&list, sep))) { + while (NULL != (tok = strsep(&list, ", \t"))) { if (strcasecmp (tok, "EXCEPT") == 0) { /* EXCEPT: give up */ break; } else if ((*match_fn)(tok, item)) { - while ( (NULL != (tok = strsep(&list, sep))) + while ( (NULL != (tok = strsep(&list, ", \t"))) && (strcasecmp (tok, "EXCEPT") != 0)) /* VOID */ ; if (tok == NULL || !list_match(list, item, match_fn)) {