From d01684a2f0f84a3d4210bb76a7ca62c4253b8e93 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Thu, 26 Mar 2026 11:06:04 +0900 Subject: [PATCH] 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 --- lib/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }