Skip to content

Commit

Permalink
src/login_nopam.c: list_match(): Remove local variable
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Colomar <alx@kernel.org>
  • Loading branch information
alejandro-colomar committed Jan 18, 2025
1 parent efc6bbc commit ba5bb87
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/login_nopam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand All @@ -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)) {
Expand Down

0 comments on commit ba5bb87

Please sign in to comment.