]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/login_nopam.c: list_match(): Remove local variable
authorAlejandro Colomar <alx@kernel.org>
Sat, 18 Jan 2025 18:30:12 +0000 (19:30 +0100)
committerAlejandro Colomar <alx@kernel.org>
Sat, 18 Jan 2025 20:32:20 +0000 (21:32 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/login_nopam.c

index 492f6e2093a2c49f538118041c3c3d8bcfe5ccff..ca04f68bbdb1b4316cc654d86e4bff07e0d09633 100644 (file)
@@ -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)) {