From: Inseob Kim Date: Thu, 26 Mar 2026 02:06:04 +0000 (+0900) Subject: lib: parser: fix match_wildcard to correctly handle trailing stars X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d01684a2f0f84a3d4210bb76a7ca62c4253b8e93;p=thirdparty%2Fkernel%2Fstable.git lib: parser: fix match_wildcard to correctly handle trailing stars This fixes a bug in match_wildcard that incorrectly handles trailing asterisks. For example, `match_wildcard("abc**", "abc")` must return true, but it returns false. Link: https://lkml.kernel.org/r/20260326020630.4139520-1-inseob@google.com Signed-off-by: Inseob Kim Cc: Changbin Du Cc: Jason Baron Cc: Joe Perches Cc: Josh Law Signed-off-by: Andrew Morton --- diff --git a/lib/parser.c b/lib/parser.c index 73e8f8e5be73..62da0ac0d438 100644 --- a/lib/parser.c +++ b/lib/parser.c @@ -315,7 +315,7 @@ bool match_wildcard(const char *pattern, const char *str) } } - if (*p == '*') + while (*p == '*') ++p; return !*p; }