From: Alejandro Colomar Date: Thu, 16 Jan 2025 21:30:56 +0000 (+0100) Subject: src/login_nopam.c: list_match(): Move code around X-Git-Tag: 4.17.3~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efc6bbc7082f1820df15276e1f98f6e8053da6ba;p=thirdparty%2Fshadow.git src/login_nopam.c: list_match(): Move code around This is just a no-op refactor in preparation for the following commits. Signed-off-by: Alejandro Colomar --- diff --git a/src/login_nopam.c b/src/login_nopam.c index 0a027fcdc..492f6e209 100644 --- a/src/login_nopam.c +++ b/src/login_nopam.c @@ -149,7 +149,6 @@ list_match(char *list, const char *item, bool (*match_fn)(char *, const char*)) static const char sep[] = ", \t"; char *tok; - bool match = false; /* * Process tokens one at a time. We have exhausted all possible matches @@ -162,20 +161,16 @@ list_match(char *list, const char *item, bool (*match_fn)(char *, const char*)) break; } else if ((*match_fn)(tok, item)) { - match = true; + while ( (NULL != (tok = strsep(&list, sep))) + && (strcasecmp (tok, "EXCEPT") != 0)) + /* VOID */ ; + if (tok == NULL || !list_match(list, item, match_fn)) { + return true; + } break; } } - /* Process exceptions to matches. */ - if (match) { - while ( (NULL != (tok = strsep(&list, sep))) - && (strcasecmp (tok, "EXCEPT") != 0)) - /* VOID */ ; - if (tok == NULL || !list_match(list, item, match_fn)) { - return true; - } - } return false; }