Skip to content

Commit d01684a

Browse files
iskim517akpm00
authored andcommitted
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 <inseob@google.com> Cc: Changbin Du <changbin.du@gmail.com> Cc: Jason Baron <jbaron@akamai.com> Cc: Joe Perches <joe@perches.com> Cc: Josh Law <objecting@objecting.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 0913b75 commit d01684a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ bool match_wildcard(const char *pattern, const char *str)
315315
}
316316
}
317317

318-
if (*p == '*')
318+
while (*p == '*')
319319
++p;
320320
return !*p;
321321
}

0 commit comments

Comments
 (0)