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/[email protected]
Signed-off-by: Inseob Kim <[email protected]>
Cc: Changbin Du <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Josh Law <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
Inseob Kim
2026-04-02 23:36:24 -07:00
committed by Andrew Morton
parent 0913b75547
commit d01684a2f0
+1 -1
View File
@@ -315,7 +315,7 @@ bool match_wildcard(const char *pattern, const char *str)
}
}
if (*p == '*')
while (*p == '*')
++p;
return !*p;
}